Subject: Bug: date(1) -d "relative-to-skipped-time" problem (also in touch(1) -d)

From: Aleš Kantor <[email-masked]>
Date: Tue, 12 Mar 2013 14:54:46 -0700

Set date to Mar 10, 2013  (the day clocks moved fwd)

This command
     date -d 2:30am
gives "Invalid date," probably reasonable, since that time didn't exist.

This one should work, but fails as well:
   date  -d "2:00am yesterday"
date: invalid date `2:00am yesterday'

Any _relative_ reference to the missing chunk of time will produce an error.

Regards,

Aleš Kantor
IT System Administrator
CollegeNET, Inc

date (GNU coreutils) 8.13
Copyright (C) 2011 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.

touch (GNU coreutils) 8.13
Copyright (C) 2011 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 Paul Rubin, Arnold Robbins, Jim Kingdon,
David MacKenzie, and Randy Smith.

cat /etc/debian_version
7.0

root@ft:~# date  -d "2:00am yesterday"
date: invalid date `2:00am yesterday'
root@ft:~# date  -d "2:00am Monday"
date: invalid date `2:00am Monday'
root@ft:~# date  -d "2:10am Monday"
date: invalid date `2:10am Monday'
root@ft:~# date  -d "2:10am Jan 1"
Tue Jan  1 02:10:00 PST 2013
root@ft:~# date  -d "2:10am yesterday"
date: invalid date `2:10am yesterday'
root@ft:~# date  -d "2:10am tomorrow"
date: invalid date `2:10am tomorrow'
root@ft:~# date  -d "2:10am next week"
date: invalid date `2:10am next week'
root@ft:~# date  -d "1:10am next week"
Sun Mar 17 01:10:00 PDT 2013