Earlier quoted context omitted.
N. The offsets between two time zones will remain constant. N+1. OK, historical oddities aside, the offsets between two time zones won't change in the future . N+2. Changes in the offsets between time zones will occur with plenty of advance notice. N+3. Daylight savings time happens at the same time every year. N+4. Daylight savings time happens at the same time in every time zone. N+5. Daylight savings time always a…
> September 1752 had 19 days: 1, 2, 14, 15, ..., 29, 30. That's only in the British Empire. Other countries moved to the Gregorian Calendar at different times. It began being adopted on 15 October 1582 (the day after 4 October 1582) in some Roman Catholic countries (Spain, Portugal, Italy, Poland). Russia didn't switch until 1918. So, you could also have: N+8. There is only one calendar system in use at one time. And…
Falsehoods Programmers believe about Time
71–80 of 222 posts
Re: Falsehoods Programmers believe about Time
#72N+?? The time library in your programming language is correct. Every time library I've ever dealt with will have serious problems with at least one issue listed on the original article or in the comments here. JodaTime (on the JVM) is by far the best, but even they have problems, and are creating a new library to solve those.
Now they have N+1 problems.
Re: Falsehoods Programmers believe about Time
#73I'm so guilty of that one.
Re: Falsehoods Programmers believe about Time
#74Re: Falsehoods Programmers believe about Time
#75Re: Falsehoods Programmers believe about Time
#76And it doesn't even mention all the bizarre things that have been done (for reasons good and bad) to time by various governments. Like adjusting from local solar time to standard GMT offset timezones (which involves skipping a given number of minutes and seconds or having them twice). Or introducing/abolishing/moving around daylight savings time. Or "super daylight savings time" with a 2 hour offset. Or moving from o…
Re: Falsehoods Programmers believe about Time
#77If you really want to stress test time handling code, try to get it to accept Feburary 29, 1900 and Feburary 29, 2000. The first doesn't exist but the second does. But really, with regards to time use whatever library came with you programming language.
That will stress it a bit, but to really torture it, see if it accepts 2012 June 30 23:59:60
Re: Falsehoods Programmers believe about Time
#78What about time can you depend on?
Re: Falsehoods Programmers believe about Time
#79Re: Falsehoods Programmers believe about Time
#80How about, "the difference between two timestamps is an accurate measure of the time that elapsed between them".
What's wrong about that? Numerical issues due to the truncation (ie 2500ms → 2s) and subsequent subtraction? Leap seconds? Anything else?