-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
time: unable to parse UTC leap seconds #8728
Comments
Has this been kicked off into the long grass? It's a shame it isn't getting some attention (especially in view of Java8 having finally sorted out the Java implementation https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html). |
This is somewhat related to Cloudflare's outtage this year: How and why the leap second affected Cloudflare DNS |
It would not be difficult to support leap seconds. See https://commons.wikimedia.org/wiki/File:Avoid_Using_POSIX_time_t_for_Telling_Time.pdf for some suggestions on how. |
@PaluMacil - Not really. There was no parsing of ":60" involved in that particular problem. |
Note that not very many other languages support parsing Those that do stub it for Ultimately, the problem is that most internal data structures store a number of units since some epoch, and don't track a table of leap seconds. Doing so would come at a performance and maintenance cost that's usually not worth it. Unix Time, for example, is explicitly the number of non-leap seconds since |
Also note that #15247 already documented that leap seconds are not accounted for in calculations. I see no reason that parsing should be any different. |
The options here are either (1) parse seconds=60 as seconds=59, or (2) continue to return an error. Given that we've returned an error this far with minimal fallout and also that .NET and even JavaScript (not exactly known as a picky language!) return errors, I am comfortable continuing to return an error. |
The text was updated successfully, but these errors were encountered: