linux中施用date获取历史时间 Home » IDC云服务 » linux中施用date获取历史时间 linux中使用date获取历史时间 脚本demo.sh的内容如下: ? str=$(date +%Y%m –date ‘1 months ago’)touch $str ? 解释: 第一句:获取1个月以前的时间,结果为201004。 ? ? ? ? 获取1天前的时间: str=$(date +%Y%m –date ‘1 days ago’)