How to convert epoch timestamp to human readable date format in Bash?

In Bash, how to convert an epoch timestamp to a human readable date format?

asked May 27, 2017 by dtivl (2,500 points)

1 Answer

In Bash, you can use the date command's -d option:

date -d @<your epoch>

Here @ specifies the epoch timestamp.

One example:

$ date -d @1490157520.05
Wed Mar 22 12:38:40 HKT 2017
answered May 27, 2017 by dtivl (2,500 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost