#!/bin/bash
starttime=$(date "+%Y-%m-%d 00:00:00" -d "-1 day")
endtime=$(date "+%Y-%m-%d 23:59:59" -d "-1 day")
echo ${time1}
starttime1=`date -d "$starttime" +%s`
endtime1=`date -d "$endtime" +%s`
echo -e "时间区间是 $starttime - $endtime"
echo -e "时间戳区间 $starttime1 - $endtime1"
shell 通过 data命令实现 时间戳 和 时间 相互转换
免责声明:文章转载自《shell 通过 data命令实现 时间戳 和 时间 相互转换》仅用于学习参考。如对内容有疑问,请及时联系本站处理。
上篇linux(centos7) 常用命令和快捷键 持续验证更新中...【2052】猴子选大王下篇
宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=