Hello,
Â
I recently discovered a bug, or at least unexpected behavior, about the ‘date’
command which I want to report. The bug is related to the moment of ‘daylight
saving time’ (summertime / wintertime)
Â
On Monday the 28st of march at 0.15 I run an automated script with the command:
# date -d yesterday +%d-%m-%Y
Â
The return of that command was 26-03-2016 where I expected 27-03-2016. (2 days
before, where I expected only 1 day before)
Â
My only explanation is that the command is run the day after 27-3-2016, the day
that the our region switched from summertime to wintertime. At 2.00 the clock
is forwarded to 3.00 so the day is only 23 hours long. When I request a
‘yesterday at 28-03-20160.15 the request is about 24 hours before. The answer
is 26-03-2016 at 23.15.
Â
Anyway, a ‘date -d yesterday’ should return 1 day before, not 2 days before.Â
In my case, as a result of it, an automated shell script went wrong.
Â
Please, can you fix this ‘daylight saving time’ related bug?
Â
More info:
Â
Timezone: Amsterdam, europe
Â
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.7 (Santiago)
Â
# 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.
Â
Many thanks! If you need further information, please let me know.
Â
Best regards,
Â
Maarten Mastbroek
Â