Skip to content
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

Instant.from-posix is too eager with adding extra 10 seconds for TAI - UTC difference #5805

Open
p6rt opened this issue Nov 17, 2016 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Nov 17, 2016

Migrated from rt.perl.org#130123 (status was 'open')

Searchable as RT130123$

@p6rt
Copy link
Author

p6rt commented Nov 17, 2016

From @zoffixznet

The Instant.from-posix adds leap seconds to the provided argument​:

  <ZoffixW> m​: say Instant.from-posix​: 99999990
  <camelia> rakudo-moar 2432c4​: OUTPUT«Instant​:100000002␤»

And if you give low-enough values, you'll notice there's a special
value of 10 seconds that's added regardless of what the given argument
is​:

  <ZoffixW> m​: say Instant.from-posix​: 0
  <camelia> rakudo-moar 2432c4​: OUTPUT«Instant​:10␤»
  <ZoffixW> m​: say Instant.from-posix​: -1010
  <camelia> rakudo-moar 2432c4​: OUTPUT«Instant​:-1000␤»
  <ZoffixW> m​: say Instant.from-posix​: 10000
  <camelia> rakudo-moar 2432c4​: OUTPUT«Instant​:10010␤»

However, it appears those 10 extra seconds are not supposed to be
there prior to the start of 1972 (I've not yet found the exact moment
in time).

From Wikipedia's aticle on TAI[^1]​:

  TAI is exactly 36 seconds ahead of UTC. The 36 seconds results
from the *****initial difference of 10 seconds at the start of
1972*****, plus 26 leap seconds in UTC since 1972.

So to me, it appears like the method must not add those extra 10
seconds for anything prior to some specific time in 1972.

[1] https://en.wikipedia.org/wiki/International_Atomic_Time

@p6rt
Copy link
Author

p6rt commented Nov 17, 2016

From @lizmat

On 17 Nov 2016, at 21​:51, Zoffix Znet (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Zoffix Znet
# Please include the string​: [perl #​130123]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=130123 >

The Instant.from-posix adds leap seconds to the provided argument​:

\<ZoffixW> m&#8203;: say Instant\.from\-posix&#8203;: 99999990
\<camelia> rakudo\-moar 2432c4&#8203;: OUTPUT«Instant&#8203;:100000002␤»

And if you give low-enough values, you'll notice there's a special
value of 10 seconds that's added regardless of what the given argument
is​:

\<ZoffixW> m&#8203;: say Instant\.from\-posix&#8203;: 0
\<camelia> rakudo\-moar 2432c4&#8203;: OUTPUT«Instant&#8203;:10␤»
\<ZoffixW> m&#8203;: say Instant\.from\-posix&#8203;: \-1010
\<camelia> rakudo\-moar 2432c4&#8203;: OUTPUT«Instant&#8203;:\-1000␤»
\<ZoffixW> m&#8203;: say Instant\.from\-posix&#8203;: 10000
\<camelia> rakudo\-moar 2432c4&#8203;: OUTPUT«Instant&#8203;:10010␤»

However, it appears those 10 extra seconds are not supposed to be
there prior to the start of 1972 (I've not yet found the exact moment
in time).

From Wikipedia's aticle on TAI[^1]​:

TAI is exactly 36 seconds ahead of UTC\. The 36 seconds results  

from the *****initial difference of 10 seconds at the start of
1972*****, plus 26 leap seconds in UTC since 1972.

So to me, it appears like the method must not add those extra 10
seconds for anything prior to some specific time in 1972.

[1] https://en.wikipedia.org/wiki/International_Atomic_Time

I interpret

https://en.wikipedia.org/wiki/Leap_second

as the current behaviour being correct (since at least 1958).

Liz

@p6rt
Copy link
Author

p6rt commented Nov 17, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 17, 2016

From @lizmat

On 17 Nov 2016, at 21​:51, Zoffix Znet (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Zoffix Znet
# Please include the string​: [perl #​130123]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=130123 >

The Instant.from-posix adds leap seconds to the provided argument​:

\<ZoffixW> m&#8203;: say Instant\.from\-posix&#8203;: 99999990
\<camelia> rakudo\-moar 2432c4&#8203;: OUTPUT«Instant&#8203;:100000002␤»

And if you give low-enough values, you'll notice there's a special
value of 10 seconds that's added regardless of what the given argument
is​:

\<ZoffixW> m&#8203;: say Instant\.from\-posix&#8203;: 0
\<camelia> rakudo\-moar 2432c4&#8203;: OUTPUT«Instant&#8203;:10␤»
\<ZoffixW> m&#8203;: say Instant\.from\-posix&#8203;: \-1010
\<camelia> rakudo\-moar 2432c4&#8203;: OUTPUT«Instant&#8203;:\-1000␤»
\<ZoffixW> m&#8203;: say Instant\.from\-posix&#8203;: 10000
\<camelia> rakudo\-moar 2432c4&#8203;: OUTPUT«Instant&#8203;:10010␤»

However, it appears those 10 extra seconds are not supposed to be
there prior to the start of 1972 (I've not yet found the exact moment
in time).

From Wikipedia's aticle on TAI[^1]​:

TAI is exactly 36 seconds ahead of UTC\. The 36 seconds results  

from the *****initial difference of 10 seconds at the start of
1972*****, plus 26 leap seconds in UTC since 1972.

So to me, it appears like the method must not add those extra 10
seconds for anything prior to some specific time in 1972.

[1] https://en.wikipedia.org/wiki/International_Atomic_Time

I interpret

https://en.wikipedia.org/wiki/Leap_second

as the current behaviour being correct (since at least 1958).

Liz

@p6rt
Copy link
Author

p6rt commented Nov 17, 2016

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant