How to Print the Epoch using date Command

Shahriar Shovon

Supported OS

  • All

Categories

Share this post with your friends

To print epoch - The seconds that has passed since 1970-01-01 00:00:00 UTC, run the following command, date +"%s" 1480572641 Here %s tells date to print the epoch. Tested on: CentOS 7, Debian 8, Ubuntu 16.04