Getting TAI time under GNU/Linux seems to be quite challenging. I came up with a rather hacky approach that seems to work: http://iki.fi/lindi/tai.c -- can you figure out how to clean that up?
Posted Jul 4, 2012 18:49 UTC (Wed) by kleptog (subscriber, #1183)
[Link]
Well, you can demonstrate it fairly easily on the command-line:
$ TZ="right/UTC" date ; TZ="posix/UTC" date
Wed Jul 4 18:26:24 UTC 2012
Wed Jul 4 18:26:49 UTC 2012
What you need is a library that can easily open multiple timezones at once. I thought glibc could do it, but it doesn't appear to, from reading the source. However, GLib seems to have support. I would have thought the g_time_zone_get_offset() would be enough, but apparently not. Actually, even though I can open both zones I can't convince GLib to give me the answer :(. Though it must be possible.
Leaping seconds and looping servers
Posted Jul 4, 2012 19:38 UTC (Wed) by lindi (subscriber, #53135)
[Link]
Thanks for the pointer! If we had an easy way to get TAI I'd seriously consider using it in our internal systems since many parts already assume they can use simple substraction to get lengths of time intervals.
tai.c - why return t + 10?
Posted Jul 6, 2012 4:48 UTC (Fri) by pr1268 (subscriber, #24648)
[Link]
Why return t + 10;?
I'm also curious about the curl braces creating a new scope but no if() / do / while() code.
I'm not trying to be critical; just a little curious...
tai.c - why return t + 10?
Posted Jul 6, 2012 5:43 UTC (Fri) by lindi (subscriber, #53135)
[Link]
Posted Jul 8, 2012 1:53 UTC (Sun) by pr1268 (subscriber, #24648)
[Link]
I was then going to ask why add ten seconds, but then I found out what the ten seconds were about (scroll down to the image titled "Time scales since the cesium atomic frequency standard").