Get epoch time for a particular date using the date command

You can get the current epoch time from the date command with this simple format specifier:

$ date '+%s'
1577810224

You can get the epoch time for a particular date using the following command:

$ date --date="12/31/2019" '+%s'
1577772000
$ date --date="12/31/2019 12:01AM" '+%s'
1577772060

You may also like...