home master site

Converting tai64 timestamps to unixtime

The tai64nunix program

tai64nunix converts precise TAI64N timestamps to a unix-time approximation. It works much like tai64nlocal delivered within D.J.B's daemontools package. All restrictions of tai64nlocal apply to tai64nunix, too.

Installation

Download tai64nunix-1.1.1.tar.gz and extract it in a temporary directory.
to compile, enter

make
make setup check

It will install the tai64nunix program in /usr/local/bin and add a symlink to /command.

Interface

tai64nunix reads lines from stdin. If a line does not begin with @, tai64nunix writes it to stdout without change. If a line begins with @, tai64nunix looks for a timestamp after the @, in the format printed by tai64n, and writes the line to stdout with the timestamp converted to local time in unix time format: seconds since Epoch. For example, in the US/Pacific time zone, the input line

     @4000000037c219bf2ef02e94 mark

should be printed as

     935467445 mark

Credits

Author: Patrick Atamaniuk <atamaniuk at frobs dot net>

References

D.J. Bernstein daemontools