将标准时间转换成unix时间戳
$ date +%s # 当前时间1379417610$ date -d "20130917 19:33" +%s # 指定的时间1379417580$ date -d "2013-09-17 19:33" +%s # 不同时间表示方式1379417580
将unix时间戳转换成标准时间
$ date -d "1970-01-01 UTC 1379417610 seconds" # 指定时间戳Tue Sep 17 19:33:30 CST 2013
本文共 294 字,大约阅读时间需要 1 分钟。
$ date +%s # 当前时间1379417610$ date -d "20130917 19:33" +%s # 指定的时间1379417580$ date -d "2013-09-17 19:33" +%s # 不同时间表示方式1379417580
$ date -d "1970-01-01 UTC 1379417610 seconds" # 指定时间戳Tue Sep 17 19:33:30 CST 2013
转载于:https://my.oschina.net/shelllife/blog/162084