« IE Firefox 浏览器刷新和强制刷新发送的 HTTP Request Header | Main | mysql HEAP MEMORY tables 提高行数支持的方法 »
May 28, 2006
date touch 时间相关
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。 https://windtear.net/archives/2006/05/28/000993.html http://windtear.net/archives/2006/05/28/000993.html date touch 时间相关 -d, --date=STRING 是 date touch 都支持的 man touch -d, --date=STRING -t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time --time=WORD set time given by WORD: access atime use (same as -a) modify mtime (same as -m) touch 使用举例: # touch -d "20040428 01:18:18" test.touch.txt or # touch -t 0605281500 test.touch.txt date 使用举例: % date Wed Apr 28 01:17:17 CST 2004 % date --date=yesterday Tue Apr 27 01:17:40 CST 2004 % date --date=yesterday +%Y%m%d 20040427 % date --date="2 days ago" +%Y%m%d 20040426 % date -s "20040428 01:18:18" % date -s "01:18:18" shell: % date +%s 1128621784 % date -d "1970-01-01 UTC 1128621784 seconds" Fri Oct 7 02:03:04 CST 2005 perl: % perl -e 'print scalar localtime 1128621784' Fri Oct 7 02:03:04 2005 php: date('Y-m-d H:i:s',time()); 相关文章: c shell perl php下的日期时间转换: 秒数与人类可读日期... http://windtear.net/archives/2005/10/07/000791.html ntpdate time synchronization & date usage http://windtear.net/archives/2004/04/28/000307.html |
Posted by windtear at May 28, 2006 11:59 PM