date在时间转换上不同版本的差异
# date –version
date (coreutils) 5.2.1
Written by David MacKenzie.
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@node40 data]# date +%s
1235955408
# date -d @1235955408
date: invalid date `@1235955408′
# date -d “1970-01-01 UTC 1235955408 seconds”
Mon Mar 2 08:56:48 CST 2009
$ date –version
date (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License .
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
$ date -d @1235955408
Mon Mar 2 08:56:48 CST 2009
$ date -d “1970-01-01 UTC 1235955408 seconds”
Mon Mar 2 08:56:48 CST 2009