有人可以解释一下吗?仅当时间为 1 或 2 时,它才会返回“无效日期”。凌晨 3 点之后,它会转换为 unix 时间戳。
[user@localhost ~]$ date --version
date (GNU coreutils) 8.4
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
[user@localhost ~]$ date --date="Sun Mar 10 01:59:00 PDT 2013" +%s
date: invalid date `Sun Mar 10 01:59:00 PDT 2013'
[user@localhost ~]$ date --date="Sun Mar 10 02:59:00 PDT 2013" +%s
date: invalid date `Sun Mar 10 02:59:00 PDT 2013'
[user@localhost ~]$ date --date="Sun Mar 10 03:59:00 PDT 2013" +%s
1362913140
[user@localhost ~]$ date --date="Sun Mar 10 04:59:00 PDT 2013" +%s
1362916740
谢谢!