News for hackers. Stuff that matters.
Re:June 30th 2012 will be 1 second longer: 23:59:60 by DanWaterworth on Thursday June 14, 2012 @01:13PM (#4112383)
I wonder how many people will be woken in the middle of the night by bugs caused by this.
Re:June 30th 2012 will be 1 second longer: 23:59:60 by Cushman on Thursday June 14, 2012 @01:44PM (#4112565)
This is definitely something you should worry about if you rolled any of your own time code. The POSIX standard is consistent across days, including leap seconds. That means that your Unix timestamp will jump back a second: it will go from 1341100800.9...[0] to 1341100800. If you're relying somewhere on seconds being continuous, or on a one-to-one mapping between timestamps and seconds, this could fuck things up.

Although 1341100800 refers to two seconds, when converting to UTC it should always become 00:00:00. Your implementation may not be conforming to the standard, though. Make sure to test.

(I'm sure if you rolled your own time code, you already know about this stuff. Probably other folks are curious though :)

[0] I think this is the second we're talking about, not positive though.

Re:June 30th 2012 will be 1 second longer: 23:59:60 by arohner on Thursday June 14, 2012 @06:43PM (#4113925)
I've found or read about bugs in nearly every stdlib time library I've ever worked in, except Joda time[1].

If you rolled your own, you should worry more, but you should still think about it even if you didn't roll your own.

[1] Joda is awesome, and by far better than any other time lib out there, but even they have bugs they're fixing in JSR310 (http://jcp.org/en/jsr/detail?id=310)

Re:June 30th 2012 will be 1 second longer: 23:59:60 by scorpion032 on Thursday June 14, 2012 @01:43PM (#4112562)
Yup. Gain 1 second. Lose hours debugging the problems that causes. Not worth it. :P
Re:June 30th 2012 will be 1 second longer: 23:59:60 by dllthomas on Thursday June 14, 2012 @01:56PM (#4112637)
Amusing, but the issue is not really gaining or losing seconds, but keeping the clock synched to the rotation of the Earth. As long as we're going to all the trouble of dealing with timezones to make sure our wall clocks have a roughly consistent relationship to when the sun is in the sky, we should be doing this kind of thing as well.
Re:June 30th 2012 will be 1 second longer: 23:59:60 by btilly on Thursday June 14, 2012 @05:43PM (#4113665)
No we shouldn't. If everything was done perfectly, then on average your timezone is already out of whack with local solar time by about 15 minutes or so. Of course we don't do it perfectly, most of us jump another hour back and forth each year for no particularly good reason. Who cares about another second? Just let solar and calendar time drift apart.

The amount of time until a timezone is noticeably out of whack with solar time is substantially longer than how long timezones have existed in anything like the modern form. In a thousand years maybe we'll start moving timezones around. But the cost of moving them for astronomical reasons will happen orders of magnitude less often than moving them for random political reasons.

I have read arguments both ways. And I remain convinced that letting UTC slowly drift away from Greenwich is a perfectly reasonable solution that will save us from many potential software bugs, and will cause no significant disruptions in life for the next ten thousand years. Of course eventually the Earth's rotation will slow down enough that the drift of time zones will become noticeable on a human time scale. But that problem is many thousands of years off, let them solve it then. If all goes well they will have had to figure out how they want to handle local calendar time not fitting UTC for people living on asteroids and other planets, and can just adapt that solution to Earth...

Re:June 30th 2012 will be 1 second longer: 23:59:60 by willyt on Thursday June 14, 2012 @06:29PM (#4113867)
Navigational accuracy? Do we still need accurate time to compute longitude relative to a point on earth?
Re:June 30th 2012 will be 1 second longer: 23:59:60 by btilly on Thursday June 14, 2012 @06:52PM (#4113960)
In a world with GPS, no.

But when you have that specialized need, it is easy enough to remember an offset. And less work for the handful of people who want that to look up the offset (which only changes every few years) than it is to expect every clock in every computer to change every so often.

The only people who really benefit from this are a handful of astronomers. But they are already used to keeping multiple clocks, and having them adjust their software programs is less work than having everyone else's computers reset.

Re:June 30th 2012 will be 1 second longer: 23:59:60 by excuse-me on Thursday June 14, 2012 @05:04PM (#4113509)
That's what they say when they steal an hour of my sleep every spring!
Re:June 30th 2012 will be 1 second longer: 23:59:60 by Splines on Thursday June 14, 2012 @03:20PM (#4113055)
Me too. I'd be really interested to hear their story. Has anyone been involved with fixing a system that would have been provably broken by stuff like this (and other things like Y2K)?

Bonus points if you were working on critical public infrastructure like a nuclear power plant.

Worst thing in recent history that I remember is the Zune's leap-year bug: http://en.wikipedia.org/wiki/Zune#First_generation

Re:June 30th 2012 will be 1 second longer: 23:59:60 by freehunter on Thursday June 14, 2012 @01:28PM (#4112466)
At least on Cisco systems, you can add a leap second [1], and at least on my network the tolerance is set at 5 minutes. So network time should still be working. For clients that might not know how to deal with a leap second but still poll network time, I only see issues in the rare case that the client polls the server at exactly 23:59:60. In that situation, they might poll back again to grab a new time thinking it's wrong.

Of course there will always be outliers and poorly coded applications that rely on time, but at least it's not a Y2K style situation.

[1] http://www.cisco.com/en/US/tech/tk869/tk769/technologies_whi...

Re:June 30th 2012 will be 1 second longer: 23:59:60 by rmc on Thursday June 14, 2012 @02:05PM (#4112688)
Well it happens every 1½ years or so…
Re:June 30th 2012 will be 1 second longer: 23:59:60 by heliodor on Thursday June 14, 2012 @05:27PM (#4113587)
Not many. Which begs the question, why is this the top link on HN?
Re:June 30th 2012 will be 1 second longer: 23:59:60 by IsTom on Friday June 15, 2012 @04:46PM (#4118627)
People will look at each other and ask: "I always use CLOCK_MONOTONIC, do you?"