Here’s how to calculate epoch time using the Linux date command.

<pre lang="bash">
# Linux
date --date @1561266781
date -d @1561266781
# MacOS
date -r 1561266781

Output is : Sun Jun 23 05:13:01 UTC 2019

Show current epoch time.

<pre lang="bash">date +%s

Output: 1561642643