[bash] unix time to date format

-----------------------
function print_date_by_unix_time
{
  LOCALE="+9hour"
  date -d "1970-01-01 $1 seconds ${LOCALE}"
}
-----------------------

Output Example
# print_date_by_unix_time `date +%s`

Fri Jan 29 20:40:23 KST 2016
# print_date_by_unix_time 1354067587
Wed Nov 28 10:53:07 KST 2012

Comments

Popular posts from this blog

e1000e 0000:00:1f.6 eno1: Detected Hardware Unit Hang

[WordPress] Change https redirect in DB.

sanitize on in CMakeLists.txt