News for hackers. Stuff that matters.
Re:Time in Go by enneff on Thursday September 10, 2015 @03:16AM (#10196525)
So what's a better time library? Or, rather, how could Go's time library better accommodate these things? It's also not clear that a standard library time package should be the be-all, end-all time management solution. I don't see any reason for a standard time package to handle historical dates, for example.

Google found a nice solution to the leap second issue: we "smear" the second over the day before it occurs by making tiny changes to the time over the day. This means user applications don't need to be aware of it: http://googleblog.blogspot.com.au/2011/09/time-technology-an...

Re:Time in Go by masklinn on Thursday September 10, 2015 @04:34AM (#10196805)
> So what's a better time library?

JSR 310/Project Kenai/Joda Next is often held up as the gold standard of complete, correct datetime handling.

Re:Time in Go by draegtun on Friday September 11, 2015 @05:43AM (#10202788)
And I would also add Perl's DateTime library to this list - https://metacpan.org/pod/DateTime
Re:Time in Go by Animats on Thursday September 10, 2015 @03:52AM (#10196645)
The power grid people do that, but after the leap second. It takes about four hours, as every 1800 RPM synchronous motor and generator on the grid makes 30 extra turns.
Re:Time in Go by tel on Thursday September 10, 2015 @08:59AM (#10197736)
Haskell's `time` (and its faster, lensier, API-compatible copy, `thyme`) handle these issues with aplomb and have been around a while.

You'll also want to include timezone-series and timezone-olson for accurate TZ handling.

    https://hackage.haskell.org/package/time
    https://hackage.haskell.org/package/thyme
    https://hackage.haskell.org/package/timezone-series
    https://hackage.haskell.org/package/timezone-olson
Re:Time in Go by simi_ on Thursday September 10, 2015 @05:41AM (#10197042)
I was going to mention the same thing wrt leap seconds: if a company at Google's scale could apply a "hacky" solution to this, then you don't really need a more "scalable" solution. The fact that it simplifies things massively for the developers can be a turn off for some people, though.
Re:Time in Go by kibwen on Thursday September 10, 2015 @12:36PM (#10199050)
You've got it backwards: a company of Google's scale can do this because they're already providing and administering their own NTP servers. For a company of a smaller scale, that's an unnecessary cost.

That said, I'm intrigued at the idea of a public NTP server that does Google-style leap-second smearing. Does anyone know if one exists?

Re:Time in Go by todd8 on Thursday September 10, 2015 @02:29PM (#10199706)
All the Network Time Protocol servers that I know of handle leap-seconds in one way or another. Some do leap-second smearing and I believe that newer versions of NTPD and OpenNTPD both support smearing. However, it appears (with only a cursory examination) that the Google time servers start smearing before the actual leap second is inserted and I've never seen that done anywhere else (or I missed it by reading too quickly).

See https://news.ycombinator.com/item?id=10199686

Also note that big changes in the way time is handled (leap seconds, etc.) in the near future because of the upcoming meeting of the International Telecommunication Union (ITU) at the World Radiocommunication Conference in November 2015.

Re:Time in Go by sla29970 on Thursday September 10, 2015 @02:48PM (#10199827)
The ITU has 4 methods for dealing with leap seconds, and method D is to change nothing. See the lack of consensus for any change in last week's presentations at http://www.itu.int/en/ITU-R/conferences/wrc/2015/irwsp/2015/... especially the "Input Document WRC-15-IRWSP-15/8" presentation by Zuzek.