Keep time and calculate intervals in epoch time, for sure. But the DST/ST switch happens at 02:00 local time on the date of the switch (always a Sunday morning in the US), and so since the OP points out that the bug only happens when DST switches at 23:00 PT…that’s why. The code was doing time-switching wrong in all zones.
But as another poster points out, when a server lives in one time zone and is used in another, all hell can easily break loose when deciding what to show the local user.
But as another poster points out, when a server lives in one time zone and is used in another, all hell can easily break loose when deciding what to show the local user.