Open kseistrup opened 2 days ago
PS: On Linux, it should be possible to do something like this in Python:
#!/usr/bin/env python
from time import (clock_gettime, CLOCK_TAI)
SECS_PER_DAY = 24 * 60 * 60
secs = clock_gettime(CLOCK_TAI) % SECS_PER_DAY
beats = round(secs * 1000 / SECS_PER_DAY, 2)
print(f':{beats:06.2f}')
# eof
E.g.:
» python beattai.py
:775.84
If I have understood this correctly, then beatTAI will show number of beats (1000th of a day) relative to TAI.
However, the Go code goes from UTC to seconds with [essentially]
(HH * 60 + MM) * 60 + SS
, and then adds TAI offset.So at 23:59:59 UTC we have
But the last centibeat in the current day should be
:999.99
.So the number of (seconds + offset) should be modulus 86400 before dividing with 86.4.
edit: typo