The article claims that the daylight savings transition happens at 11pm in pacific time. However, my understanding is that this transition should happen at 2 am for all us time zones. Where is 11pm coming from?
Maybe a cross-timezone interaction? 23:00 pacific is 02:00 eastern (most days)
The 1 Hour per Year Bug, but only in Pacific time
41–50 of 65 posts
Re: The 1 Hour per Year Bug, but only in Pacific time
#42In comes the DST rollback. At 1:59 AM Pacific Daylight time the task ran. At 2:00 AM Pacific Daylight time the time changes to 1:00 AM Pacific Standard time. For the next hour it just sees "ooh 1:01 AM is not more than 1 minutes after 1:59 AM, I'm going to sleep. 1:02 AM is not more than 1 minute after 1:59 AM..." and ends up falling behind for that hour until it magically fixes itself at 2:01 AM Pacific Standard Time
Re: The 1 Hour per Year Bug, but only in Pacific time
#43Clocks roll back at 2am Pacific time just like everywhere else - so the author's explanation seems unsatisfying although I've encountered this type of bug before.
Yeah, as soon as they said 11PM I realized, ` they're using EST as the timezone? ` which would just do it at that time for everyone using the doc? I don't work with raw date objects in JavaScript very much, is that illogical behavior from it's Date object?
The Temporal spec[1] should alleviate a lot of the JS induced pain. Knowing how to correctly store and manipulate time data, however is a completely separate issue that even really experienced engineers can easily mess up, even with solid STD lib support.
Re: The 1 Hour per Year Bug, but only in Pacific time
#44Earlier quoted context omitted.
The absolute worst are ones like “last month”, “last week” or “earlier this week” - almost absolutely useless! Especially for logs of things that happened at work, I extremely frequently want to know the day and date something happened, but that style obscures that sometimes to the point where you can’t even tell which week it was!
I also hate "1 year ago" when it was actually 23 months ago
Re: The 1 Hour per Year Bug, but only in Pacific time
#45Earlier quoted context omitted.
I also hate "1 year ago" when it was actually 23 months ago
this is what I hate about youtube, when you look at the title and says 1 year ago and its just 1 month away for 2 years lol
Re: The 1 Hour per Year Bug, but only in Pacific time
#46Clocks roll back at 2am Pacific time just like everywhere else - so the author's explanation seems unsatisfying although I've encountered this type of bug before.
Re: The 1 Hour per Year Bug, but only in Pacific time
#47Earlier quoted context omitted.
No, it isn't. That approach works fine for things like logging where are your timestamps are in the past, but the moment you have to deal with future timestamps it leads to some truly horrible issues when some political leader decides to change the definition of the timezone. Suddenly all your future epoch-based datetimes are representing the wrong wall clock time...
Timekeeping is always epoch based. When the definition changes you update the display code. There’s no way to write code today that accounts for future changes in local time.
Suppose I have an 8am alarm to wake up in the morning. I want that to happen once per day in my current local timezone. If I change locations, the epoch I'm being alarmed at should change. If I travel quickly enough to experience multiple 8ams, I only want one of them (the first one). If laws change to give me multiple 8ams in a single locale, it's ambiguous which one I want. How your alarm app handles that varies, but you should do _something_ (flag the situation in the app, pick one (if one of them is about the same epoch as the previous alarm, maybe pick that one), ...).
For calendars you have probably a different set of choices. If all participants are in the same time zone, you probably want the meeting to move as regulations change the definition of 8am. If they're in different time zones which all practice daylight savings and the meeting doesn't conflict with any of the 1-2am haunted hours then the meeting should probably move with daylight savings, reference the local time as it was defined when the meeting was created, and not move as some dictator redefines a time zone (becoming a cross between a display issue and actually considering local time). If you don't know anything as a calendar app about the participants, there will be edge cases where you make bad decisions, so you either accept that or flag the ambiguity when appropriate.
And so on.
If we can convince everyone to switch to some kind of atomic time without leap seconds I'd be tickled pink. That's not the world we live in though.
Re: The 1 Hour per Year Bug, but only in Pacific time
#48> Normally I would have dismissed that as a coincidence, but daylight saving time also ended at 11:00pm (PT) on November 7! Huh? Unless I'm mistaken, Daylight Saving ended at 2am local time on Nov 7, 2021. Was the bug that Day Saving is internally set based on Eastern Time (i.e. 2am ET / 11pm PT)?
Or it is just assuming a standard offset, not taking into account the 6 hours a year where eastern and western time isn't 3 hours apart
Re: The 1 Hour per Year Bug, but only in Pacific time
#49Clocks roll back at 2am Pacific time just like everywhere else - so the author's explanation seems unsatisfying although I've encountered this type of bug before.
[1] https://www.nist.gov/pml/time-and-frequency-division/popular...
[2] At present, daylight saving time in the United States begins at 2:00 a.m. on the second Sunday of March (at 2 a.m. the local time time skips ahead to 3 a.m. so there is one less hour in that day) [and] ends at 2:00 a.m. on the first Sunday of November (at 2 a.m. the local time becomes 1 a.m. and that hour is repeated, so there is an extra hour in that day.)
Re: The 1 Hour per Year Bug, but only in Pacific time
#50> Normally I would have dismissed that as a coincidence, but daylight saving time also ended at 11:00pm (PT) on November 7! Huh? Unless I'm mistaken, Daylight Saving ended at 2am local time on Nov 7, 2021. Was the bug that Day Saving is internally set based on Eastern Time (i.e. 2am ET / 11pm PT)?
This is my understanding as well. and and Wikipedia backs me up on it [ https://en.wikipedia.org/wiki/Pacific_Time_Zone#Daylight_tim... ]. Some of the software I've written _explicitly_ disables scheduling mobile notifications during the transition periods so I was also very confused by that. Your ET speculation makes sense to me. I'll bet that whatever server/containers being used for the backend were running in the…