Skip Menu |
Report information
Id: 128752
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: cpan [at] zoffix.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [RFC] Expose Leap Second Tables for Ease of Updating by Module Space
Download (untitled) / with headers
text/plain 1.7k
We currently have several issues with leap seconds and I propose we add an interface exposing Rakudo's leap second tables (http://bit.ly/2aeGlIQ) to the user to allow for, say, a module, importing which would make the leap second table current, regardless of the version of the compiler used. Issue #1: Fatality of code depends on compiler version ----------------------------------------------------------------------------- $ perl6-v2016.07 -e 'DateTime.new("2016-12-31T23:59:60"); say "lives"' lives $ perl6-v2016.06 -e 'DateTime.new("2016-12-31T23:59:60"); say "lives"' Second out of range. Is: 60, should be in 0..^60; There is no leap second on UTC 2016-12-31 in block <unit> at -e line 1 Issue #2: Different Instant.from-posix results, depending on compiler version: ----------------------------------------------------------------------------- $ perl6-v2016.07 -e 'say Instant.from-posix: 1485726595' Instant:1485726632 $ perl6-v2016.06 -e 'say Instant.from-posix: 1485726595' Instant:1485726631 Issue #3: Different DateTime.Instant results, depending on compiler version: ----------------------------------------------------------------------------- $ perl6-v2016.07 -e 'DateTime.new("2017-01-01T00:00:00").Instant.say' Instant:1483228837 $ perl6-v2016.06 -e 'say Instant.from-posix: 1485726595' Instant:1483228836 There are probably more methods I've not thought about that are similarly affected. I've mentioned this problem on IRC: http://irclog.perlgeek.de/perl6/2016-07-27#i_12918886 and so far got this response: [lizmat] all for exposing the dates / posix values but would probably not be in favour of allowing it to be added upon rather, so it can serve as a basis of a module that *does* allow adding ? -- Cheers, ZZ | https://twitter.com/zoffix


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org