> There are always 24 hours in a day. Is this referring to leap seconds or what do the mean?
When the timezone changes for daylight savings time, you either lose or gain 1 hour in that day (or whatever your local equivalent is).
Falsehoods programmers believe about time
201–210 of 212 posts
Re: Falsehoods programmers believe about time
#202At my previous job matching datapoints on timestamp was crucial, so we did a lot of fun things with time. Leap seconds cost us 3 months of testing.
Re: Falsehoods programmers believe about time
#203Earlier quoted context omitted.
As a 1995 immigrant, I understand what am/pm time it is 22 hours of the day, but I'm still not sure about those two 12:* mystery hours. I know, I can look it up, and I have several times. But the knowledge doesn't stick...
You have to look at it as a separate concept from the hh:mm time, pm is between midday (inclusive) and midnight (exclusive) and am the rest, between midnight (inclusive) and midday (exclusive).
The ambiguity of midday and midnight is really the cherry on top of this masterpiece of confusion.
There is probably some part of me too offended by this system to want to remember it...
Re: Falsehoods programmers believe about time
#204> The system clock will always be set to the correct local time. I work on a sometimes offline educational product for children. Kids for some reason love to mess with their system clocks. The hoops we've tried jumping through to get a reasonable time frame of events from iPads that were offline for any period of time is hilarious. We gave up, and if the time of events is unreasonable, we just shift the entire set wa…
His iPad was like 2 centuries ahead because moving the system time would give him extra lives. He couldn't practically move it back because then he'd have to wait another 2 centuries to get lives again. So his iPad was 2 centuries ahead until he completed Candy Crush.
Re: Falsehoods programmers believe about time
#205Earlier quoted context omitted.
As a 1995 immigrant, I understand what am/pm time it is 22 hours of the day, but I'm still not sure about those two 12:* mystery hours. I know, I can look it up, and I have several times. But the knowledge doesn't stick...
Post median, ante median. Translation: After midpoint, before midpoint. Also the difference in the cycles comes from analog clocks. I can explain all of this but it's still confusing and stupid to have to deal with it in 2022
As a non-native am/pm user: it's confusing. Even with that rule.
Re: Falsehoods programmers believe about time
#206Just wait till you hear about leap seconds. At my previous job matching datapoints on timestamp was crucial, so we did a lot of fun things with time. Leap seconds cost us 3 months of testing.
https://engineering.fb.com/2022/07/25/production-engineering...
Re: Falsehoods programmers believe about time
#207Earlier quoted context omitted.
During the last “fall back” event I experienced the 1 o’clock hour three times since I randomly happened to cross a time zone at exactly 2:00am…or maybe 1:00am? The worst part was I had an appointment at 02:00, somewhere where they won’t let you in if you show up too early, in the other time zone and hadn’t had to deal with daylight savings time for a good long while having lived in Arizona where they don’t deal with…
> having lived in Arizona where they don’t deal with such silliness Oh god, I'm simultaneously delighted at the idea of not having to deal with DST and terrified of writing software that might have to keep track of whether or not the user was in Arizona during a DST transition.
That's why in the utility business it's common to use the language of standard time, daylight saving time, and prevailing time. For the Eastern timezone they write it as EST, EDT, EPT respectively. The important point is EST and EDT never vary - they'e fixed offset from UTC (UTC-05:00 and UTC-04:00, respectively). EPT is the squirrelly one - sometimes it matches EST and other times it matches EDT. At least when processing a time interval you know whether you have to take clock movement into account.
Re: Falsehoods programmers believe about time
#208Earlier quoted context omitted.
Sure—changed from https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b... now. Thanks! (For some reason people think we know these things)
Falsehoods hn'ers believe about dang…
FALSE: Dang is a cosmic entity of Lovecraftian proportions who exists outside of and beyond our pitiful human conceptions of "time" and "space." Dang is eternal, dang is everywhere, dang is everything.
Re: Falsehoods programmers believe about time
#209Earlier quoted context omitted.
No, they are not. Beyond leap years and leap seconds, I know absolutely nothing about time, how to handle all the "daylight savings" and other kind of bullshit. And I actually do not care, at all. Luckily for me, people who do care and know these things have made libraries that can handle it all while expecting only minimal knowledge from me, such as being aware that time zones exist at all.
The reason why you use those libraries is that you know time is difficult and you need to be cautious. You don not blindly believe those statements about time. If pressed to answer whether they are right or wrong you would say that you are not sure.
Re: Falsehoods programmers believe about time
#210Obviously nobody believes most of these falsehoods. Presumably the op means a lot of programmers create bugs that seem t imply programmers believe these falsehoods. But this one jumped out at me: "Any 24-hour period will always begin and end in the same day". It would be a lot more plausible if "always" were replaced with "never". Add 24 hours to a time, and it will (almost) always be the next day.
Agreed on all counts. The “falsehoods programmers believe about X” articles are cautionary lists of edge cases to think about, with an unfortunately aggressive naming scheme.