`
haoningabc
  • 浏览: 1442775 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

linux date时间戳互相转换

 
阅读更多
1.查看指定时间的时间戳

查看当前时间
#date +%s

查看指定时间
#date -d 2008-01-01 +%s 
1199116800
#date -d 20080101 +%s
1199116800

2.将时间戳转换成date
#date -d '1970-01-01 UTC 1199116800 seconds'
2008年 01月 01日 星期二 00:00:00 CST

#export LANG=en
#date -d '19700101 UTC 1199116800 seconds' 
Tue Jan  1 00:00:00 CST 2008


date -d @1416387827
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics