设为首页 加入收藏

TOP

Linux时间函数的应用
2014-11-24 00:58:10 来源: 作者: 【 】 浏览:3
Tags:Linux 时间 函数 应用

由于Linux对man date -d 参数说的比较模糊,故举例如下:


# -d, --date=STRING display time described by STRING, not `now'


For Linux
[root@Gman root]# date -d next-day +%Y%m%d
20060328
[root@Gman root]# date -d last-day +%Y%m%d
20060326
[root@Gman root]# date -d yesterday +%Y%m%d
20060326
[root@Gman root]# date -d tomorrow +%Y%m%d
20060328
[root@Gman root]# date -d last-month +%Y%m
200602
[root@Gman root]# date -d next-month +%Y%m
200604
[root@Gman root]# date -d next-year +%Y
2007


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇关于Linux终端的显示 下一篇在Ubuntu中用cron实现代码自动编译

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: