Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My system uses UTC for the system clock, which I don't particularly feel like changing. Is there an easy way to get the current TAI time? (preferably a command line tool or flag)

share|improve this question
2  
Do you want to get the difference between UTC and TAI for informational purposes (e.g. it's 12:30:13 UTC and 12:30:45 TAI) or do you want to reset the clock from an external source to make up for accumulated differences on your local system? –  SvW Jul 5 '12 at 19:58
    
At the moment just for informational purposes. And in case I ever want to use it in programming, since TAI, unlike UTC, is always monotonically increasing –  JanKanis Jul 6 '12 at 9:19

3 Answers 3

There is work in progress to give Linux native support for TAI. Until then, you can use scheme-clock to convert to TAI.

share|improve this answer
    
Hmm, so there's not any easy support currently, but kernel support is coming and then we just need to wait for userland utilities to support the CLOCK_TAI option. –  JanKanis Jul 10 '12 at 9:52

You could use the "right/" timezone to display an approximation (<1s) of the TAI.

But you need to make sure that your timezone package is up-to-date (e.g. tzdata on Ubuntu).

Code:

TZ='right/UTC' date

Example:

$ date -u ; TZ='right/UTC' date
Mon Sep 16 13:36:21 UTC 2013
Mon Sep 16 13:35:56 UTC 2013
share|improve this answer

It's easy to do: just run /usr/sbin/ntpdate pool.ntp.org;/sbin/hwclock --systohc once or add it to cron. I have it set to daily.

share|improve this answer
1  
Better use something like pool.ntp.org instead of a fixed IP address to load balance the service better. –  SvW Jul 5 '12 at 19:59
4  
also the authors of ntpdate label it as unmaintained, obsolete, and deprecated. People are encouraged to use ntpd and ntp-wait instead. Its better to just have your clock always correct than have it suddenly jump to the correct time periodically. –  stew Jul 5 '12 at 20:00
2  
I think NTP issues the UTC time, not TAI time which I specifically asked for. –  JanKanis Jul 6 '12 at 9:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.