Cacomania: Unix timestamp conversion with date

Cacomania

Unix timestamp conversion with date

Guido Krömer - 10. December 2013 - Tags: ,

If you are not smart enough to interpret a Unix timestamp by yourself date can do it for you.

$ date -u -d @1234567890
Fri Feb 13 23:31:30 UTC 2009

The timestamp can be formatted, too.

$ date -u -d @1234567890 +"%Y-%m-%d %T"
2009-02-13 23:31:30

If you need a timestamp, %s lets date print one.

$ date +"%s"
1386708117