date的诸多用法

利用date将当前时间转换成秒数(从1970-01-01开始,到当前时间的秒数)

date +%s

将某一指定时间转换成秒数

date  +%s --date="2014/7/15"

date +%s --date="2014/7/15 13:00:00"

date +%s -d '2014/07/15 13:30:00'

将某一特定的秒数转换成其对应的时间

date --date="@1405454400"

Convert seconds since the epoch (1970-01-01 UTC) to a date

$ date --date='@2147483647'

Show the time on the west coast of the US (use tzselect(1) to find TZ)

$ TZ='America/Los_Angeles' date

Show the local time for 9AM next Friday on the west coast of the US

$ date --date='TZ="America/Los_Angeles" 09:00 next Fri'

            ----摘录自man page

原文地址:https://www.cnblogs.com/droidxin/p/3844508.html