how to translate human readable time to EPOCH (GNU coreutils (“date”), Perl, …) – resp. the other way round

$ date --date="2011/09/08 00:10:17.997" +%s # from human readable time to EPOCH
1315433417

$ date --utc --date="2011/09/08 00:10:17.997" +%s
1315440617

$ date -d @946684800 +"%F %T %z"
2000-01-01 01:00:00 +0100

$ date --utc --date='1970-01-01 946684800 seconds' +"%Y-%m-%d %T %z"
2000-01-01 00:00:00 +0000

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.