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

Unix block start times should always be integer numbers of milliseconds, but aren't #3

Closed
qntm opened this issue Nov 1, 2016 · 0 comments
Assignees

Comments

@qntm
Copy link
Owner

qntm commented Nov 1, 2016

> tai.leapSeconds.map(l => tai.atomicToUnix(l.atomic));
[ -283996800000,
  -265679999999.99997,
  -252460800000,
  -194659199999.99997,
  -189388800000,
  -181526400000,
  -168307200000,
  -157766400000,
  -152668800000.00003,
  -142128000000.00003,
  -136771200000,
  -126230400000.00002,
  -60480000000.00001,
  63072000000,
  78796800000,
  94694400000,
  126230400000,
  157766400000,
  189302400000,
  220924800000,
  252460800000,
  283996800000,
  315532800000,
  362793600000,
  394329600000,
  425865600000,
  489024000000,
  567993600000,
  631152000000,
  662688000000,
  709948800000,
  741484800000,
  773020800000,
  820454400000,
  867715200000,
  915148800000,
  1136073600000,
  1230768000000,
  1341100800000,
  1435708800000,
  1483228800000 ]

Those values should all be integers. Some kind of improper computation is going on here.

These discrepancies are significant, because if I pass in a Unix time of e.g. -265680000000 for conversion, it ends up falling on the wrong side of a boundary where the TAI/Unix offset changed, and returning an incorrect result.

Worst-case scenario, it may be necessary to pre-compute these values. Hmm.

@qntm qntm self-assigned this Nov 1, 2016
qntm added a commit that referenced this issue Nov 2, 2016
As per issue #2. Will probably have to do the same for Unix block start
times as per #3. And end times, in fact, since the Unix block end time
*isn't* the same as the start time of the previous block... it's not
even a precise number of Unix seconds offset, it's a precise number of
*TAI* seconds offset!!
@qntm qntm closed this as completed Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant