I'm reading my console logs and trying to figure out how to interpret the time stamp that console displays:

Time 1332251808
TimeNanoSec 72951500

I also have another time stamp that reads:

Time 1232456005

If anyone can shed some light on this it would be appreciated. Thanks!


Those are Unix time stamps, ie, the number of seconds since the Unix epoch (Jan 1 1970):

# date -d @1332251808
Tue Mar 20 13:56:48 GMT 2012

# date -d @0
Thu Jan  1 00:00:00 GMT 1970
  • thanks — that makes sense; is there an equivalent command to date -d for the nano seconds? – Mr. President Mar 20 '12 at 14:31
  • ↳ does the command above display the time or set it? on my console the command to display the number of seconds since epoch is date -r 1332251808 resulting in Tue Mar 20 06:56:48 MST 2012 – Mr. President Mar 20 '12 at 14:37
  • For me it displays, my -r option is to get the last modification date of a file. 72951500 nano seconds is 0.072951500 seconds, so you can just add them on, either before or after calling date. – Jamie Kitson Mar 20 '12 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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