Live data from Hacker News

Falsehoods Programmers believe about Time

infiniteundo.com

61–70 of 222 posts

Re: Falsehoods Programmers believe about Time

#62
post #50

Earlier quoted context omitted.

From which many modern reckonings of time descend, including the one used by all modern computer systems.

Actually, almost no country outside the British Empire (and not even Scotland inside it) implemented the Gregorian reform at the same time. Britain was pretty late in doing so, too. As for "all modern computer systems", Unix time is completely ignorant about anything except seconds.

> Unix time is completely ignorant about anything except seconds.

In hindsight, it seems like a brilliant decision.

Re: Falsehoods Programmers believe about Time

#63
N+?? 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.

Re: Falsehoods Programmers believe about Time

#64
post #31

And 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…

My favorite is when Daylight Savings Time started after an election in Brazil, but before the date for the election runoffs. Turned out the voting machines couldn't be changed to handle the time change. Solution? They just pushed back the date when DST started until after the runoffs.

http://statoids.com/tbr.html -- "Note that the government frequently changes its mind [about DST] at the last minute."

Re: Falsehoods Programmers believe about Time

#65

How 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?

Re: Falsehoods Programmers believe about Time

#66
post #50

Earlier quoted context omitted.

From which many modern reckonings of time descend, including the one used by all modern computer systems.

Actually, almost no country outside the British Empire (and not even Scotland inside it) implemented the Gregorian reform at the same time. Britain was pretty late in doing so, too. As for "all modern computer systems", Unix time is completely ignorant about anything except seconds.

Except it doesn't account for leap seconds.

Re: Falsehoods Programmers believe about Time

#67
post #55
post #30

Earlier quoted context omitted.

That will stress it a bit, but to really torture it, see if it accepts 2012 June 30 23:59:60

Well, you don't know if 31.12.2015 will have a 23:59:60 or no. These seconds are announced just prior to being added, the system couln't possibly know it.

Obviously no.

That's after the Mayapocolypse.

Re: Falsehoods Programmers believe about Time

#68
post #31

And 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…

https://en.wikipedia.org/wiki/Swedish_calendar is my personal favorite when it comes to the transition to gregorian.
Post reply on HN