在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
date用法1: 格式:date [OPTION]... [+FORMAT] FORMAT controls the output. Interpreted sequences are:
%a locale's abbreviated weekday name (e.g., Sun) %A locale's full weekday name (e.g., Sunday) %b locale's abbreviated month name (e.g., Jan) %B locale's full month name (e.g., January) %c locale's date and time (e.g., Thu Mar 3 23:05:25 2005) %C century; like %Y, except omit last two digits (e.g., 20) %d day of month (e.g., 01) %D date; same as %m/%d/%y %e day of month, space padded; same as %_d %F full date; same as %Y-%m-%d %g last two digits of year of ISO week number (see %G) %G year of ISO week number (see %V); normally useful only with %V %h same as %b
%I hour (01..12) %j day of year (001..366) %k hour, space padded ( 0..23); same as %_H
%W week number of year, with Monday as first day of week (00..53)
例如: 1.年月日 复制代码 代码如下:$ date +%Y%m%d 20150107 2.年月日,年只保留后两位 复制代码 代码如下:~$ date +%y%m%d 150107 3.小时分钟秒 复制代码 代码如下:~$ date +%H%M%S 233045 4.年月日时分秒 复制代码 代码如下:~$ date +%Y%m%d%H%M%S 20150107233145 |
请发表评论