简体   繁体   中英

Bash 'date -d' bug?

I am using Ubuntu 10.04 LTS. In bash I am getting error while converting string to date like this:

date -d '20110327 02:00'
date: invalid date `20110327 02:00'

but these work:

date -d '20110327 03:00'
Sun Mar 27 03:00:00 CEST 2011

date -d '20110326 02:00'
Sat Mar 26 02:00:00 CET 2011

date -d '20110328 02:00'
Mon Mar 28 02:00:00 CEST 2011

Any ideas? Thanks,

Jan

It's the summer time ! In 2011, we get an additionnal hour on the March 27th at 2:00 it was in fact 3:00. So 27/03/2011 2:00 is not a valid date :-)

不会,我确定当天2:00到夏时制(DST)之间有过渡,所以没有2:00 :)

嗯,没有这样的本地时间-切换到夏令时,时钟从1:59变为3:00。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM