I found using of Unix time to be very useful in various shell scripts and here are two simple commands to convert Unix/Linux
date command to Unix time format and back to regular formating:
To convert Unix time to simple (regular) time please use:
date -u --date="1970-01-01 1187769064 sec GMT"
1187769064 is input Unix time. The output will be:
Wed Aug 22 07:51:04 UTC 2007
To get Unix time seconds from regular one format just use:
date --date="Wed Aug 22 07:51:04 UTC 2007" +%s
Wed Aug 22 07:51:04 UTC 2007 is input regular time. The output will be:
Update: another way to convert Unix time into regular date is to use the following command
date -d @1187769064 (thanks to Mattias Lindvall), that is tested in Ubuntu and Fedora.