Created
March 26, 2014 06:16
-
-
Save mlf4aiur/9777698 to your computer and use it in GitHub Desktop.
Convert unix timestamp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| utime(){ date -d @$1; } | |
| utime(){ date -d "1970-01-01 GMT $1 seconds"; } | |
| utime(){ awk -v d=$1 'BEGIN{print strftime("%a %b %d %H:%M:%S %Y", d)}'; } | |
| utime(){ perl -e "print localtime($1).\"\n\""; } | |
| utime(){ python -c "import time; print(time.strftime('%a %b %d %H:%M:%S %Y', time.localtime($1)))"; } | |
| [root@test test]# utime(){ date -d @$1; } | |
| [root@test test]# utime 1273817956 | |
| Fri May 14 14:19:16 CST 2010 | |
| [root@test test]# utime 1273817956 | |
| Fri May 14 14:19:16 CST 2010 | |
| [root@test test]# utime(){ awk -v d=$1 'BEGIN{print strftime("%a %b %d %H:%M:%S %Y", d)}'; } | |
| [root@test test]# utime 1273817956 | |
| Fri May 14 14:19:16 2010 | |
| [root@test test]# utime(){ perl -e "print localtime($1).\"\n\""; } | |
| [root@test test]# utime 1273817956 | |
| Fri May 14 14:19:16 2010 | |
| [root@test test]# utime(){ python -c "import time; print(time.strftime('%a %b %d %H:%M:%S %Y', time.localtime($1)))"; } | |
| [root@test test]# utime 1273817956 | |
| Fri May 14 14:19:16 2010 | |
| [root@test test]# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment