linux shell获取时间戳,获取日期

shell获取时间戳
1 当前时间戳 date +%s
2 两小时前时间戳 date -d -2hour +%s
3 1天前时间戳 date -d “1 days ago” +%s

日期
1 当前时间 date +%s
2 两小时前 date -d -2hour +%s
3 1天前 date -d “1 days ago” +%s
分钟级别 date -d "1 hour ago 20 minute ago " +%s

你可能感兴趣的:(linux)