首页 > 其他 > 详细

日期时间相关命令

时间:2019-03-18 20:05:00      阅读:156      评论:0      收藏:0      [点我收藏+]

获取当前时间 date

1 [root@VM_0_3_centos ~]# date
2 Mon Mar 18 19:13:33 CST 2019
3 [root@VM_0_3_centos ~]# 

date相关选项;

 1 [root@VM_0_3_centos ~]# date --help
 2 Usage: date [OPTION]... [+FORMAT]
 3   or:  date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
 4 Display the current time in the given FORMAT, or set the system date.
 5 
 6   -d, --date=STRING         display time described by STRING, not `now‘
 7   -f, --file=DATEFILE       like --date once for each line of DATEFILE
 8   -r, --reference=FILE      display the last modification time of FILE
 9   -R, --rfc-2822            output date and time in RFC 2822 format.
10                             Example: Mon, 07 Aug 2006 12:34:56 -0600
11       --rfc-3339=TIMESPEC   output date and time in RFC 3339 format.
12                             TIMESPEC=`date‘, `seconds‘, or `ns‘ for
13                             date and time to the indicated precision.
14                             Date and time components are separated by
15                             a single space: 2006-08-07 12:34:56-06:00
16   -s, --set=STRING          set time described by STRING
17   -u, --utc, --universal    print or set Coordinated Universal Time
18       --help     display this help and exit
19       --version  output version information and exit

这是date在Linux系统中部分帮助信息显示的内容。其中%F%T%Y%m%d%H%M%S%s:是我们比较常用的,详细见下图所示

技术分享图片

 

日期时间相关命令

原文:https://www.cnblogs.com/061713xlhj/p/10554266.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!