Posted in Linux commands

Convert from and to Unix Timestamp

To get the actual date and time as a UNIX timestamp use the format specifier %s:

$ date '+%s'
1486931673

To change a UNIX timestamp into readable format use the parameter -d with the modifier @:

$ date -d @1486931673
Sun Feb 12 21:34:33 CET 2017
Advertisements