Subject: bug#16606: date command throws error when DST is turned on

From: "Lakshmi Ramamurthi -X (lramamur - HCL TECHNOLOGIES LIMITED at Cisco)" <[email-masked]>
Date: Fri, 31 Jan 2014 06:10:36 +0000

Hi,

The date command throws error when the DST is turned on.

# date +%s -d "2013/11/20"
1384912800
# date +%s -d "2013/10/20"
date: invalid date `2013/10/20'

1 sec after Oct 19 23:59:59 2013 becomes Oct 20 01:00:00 2013
As there is no 0th hour on Oct 20, it shows invalid date.

Are there any options to fix this problems ?
Has there been a patch posted for this.

#date
Sun Mar 10 07:02:07 BRT 2013

# zdump -v /etc/localtime | grep 2013
/etc/localtime Sun Feb 17 01:59:59 2013 UTC = Sat Feb 16 23:59:59 2013 BRST isdst=1 gmtoff=-7200
/etc/localtime Sun Feb 17 02:00:00 2013 UTC = Sat Feb 16 23:00:00 2013 BRT isdst=0 gmtoff=-10800
/etc/localtime Sun Oct 20 02:59:59 2013 UTC = Sat Oct 19 23:59:59 2013 BRT isdst=0 gmtoff=-10800
/etc/localtime Sun Oct 20 03:00:00 2013 UTC = Sun Oct 20 01:00:00 2013 BRST isdst=1 gmtoff=-7200

Thanks,
Lakshmi