invalid date format 2011
当我尝试修改时间时,我得到了,这在没有秒的情况下工作正常
touch -t 2011 08 23 14 05 14 voucher.tpl
Run Code Online (Sandbox Code Playgroud)
我对以下解释如何执行此操作的内容感到有些困惑:
-t time 使用以下格式指定特定时间:
[[[[cc]yy]MM]dd]hhmm[.ss]
Run Code Online (Sandbox Code Playgroud)
其中 cc 是可选的年份的前 2 位数字,yy 是可选的年份的后 2 位数字,MM 是可选的月份数(01-12),dd 是可选的月份日期,hh 是小时24 小时制(必需),mm 是分钟(必需),ss 是可选的秒数。
$ touch -t 201108231405.14 voucher.tpl
$ ls -l --time-style='+%B %d %H:%M:%S' voucher.tpl
-rw-r--r-- 1 quanta quanta 0 August 23 14:05:14 voucher.tpl
Run Code Online (Sandbox Code Playgroud)