UNIX epoch time conversion in Linux

Convert to human readable time to Unix epoch time using Bash

Use the built-in date command to convert to UNIX epoch time. For this example we are converting 00:15:00 14 June 2019 GMT+10

$ date "+%s" -d "06/14/2019 00:15:00 +10"

Output will be 1560435300, which is UNIX epoch time

Convert UNIX epoch time to human readable time using Bash

Use the built-in date command to reformat a UNIX epoch time into a human readable time

$ date -d @1560435300

Output of this will be Fri Jun 14 02:15:00 +10 2019.

Please note that timezone of output will depends on timezone set on system where you are running the command. So if you are running this command on system with Singapore timezone then output will be Thu Jun 13 22:15:00 +08 2019

For more ways to convert UNIX epoch time to human readable form and vice-versa, please visit UNIX epoch time conversion