Linux Fundamentals - Understanding epoch time

On a Linux system, epoch is the number of seconds that have elapsed since January 1st, 1970.

The date command with the %s option can be used to display the current epoch time. In this example, 1643368599 seconds have elapsed since January 1st, 1970.

~]$ date +%s
1643368599

 

And here is how you could convert an epoch time to human readable date time.

~]$ date -d @1655380828
Thu Jun 16 07:00:28 CDT 2022

 

Or, you can also use echo or printf.

~]$ echo $(date +%s)
1643368599

 

And here is how you could convert an epoch time to human readable date time.

~]$ echo $(date -d @1655380828)
Thu Jun 16 07:00:28 CDT 2022



Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee

Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter b5e76 in the box below so that we can be sure you are a human.