Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How do I convert an epoch timestamp to a human readable format on the cli?

How do I convert an epoch timestamp to a human readable format on the cli? I think there's a way to do it with date but the syntax eludes me (other ways welcome).
by

1 Answer

Bharatv4tg1
If your epoch time is in milliseconds instead of seconds, remove the last three digits before passing it to date -d:
$ date -d @1455086371603
Tue Nov 7 02:46:43 PST 48079 #Incorrect


This gives incorrect data. Remove the last three digits.
$ date -d @1455086371
Tue Feb 9 22:39:31 PST 2016 #Correct after removing the last three digits. You may remove and round off the last digit too.

Login / Signup to Answer the Question.