1

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!

1 Answer 1

2

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
3
  • thanks — that makes sense; is there an equivalent command to date -d for the nano seconds? Mar 20, 2012 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 Mar 20, 2012 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. Mar 20, 2012 at 14:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .