Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Expose Leap Second Tables for Ease of Updating by Module Space #5492

Open p6rt opened 8 years ago

p6rt commented 8 years ago

Migrated from rt.perl.org#128752 (status was 'new')

Searchable as RT128752$

p6rt commented 8 years ago

From @zoffixznet

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 \ 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