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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s