[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#20523: GNU coreutils 8.4 date: wrong day shift calculation at the sp
From: |
Pádraig Brady |
Subject: |
bug#20523: GNU coreutils 8.4 date: wrong day shift calculation at the spring daylight savings time cutover |
Date: |
Thu, 07 May 2015 09:45:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
forcemerge 18159 20523
stop
previously discussed at: http://bugs.gnu.org/18159
On 07/05/15 01:52, Markus Baur wrote:
> On one of my production systems I do daily database dumps between midnight
> and 1am every day. I noticed on March 9th this year is was dumping the wrong
> day. Digging further into this I found the shell wrapper script to be at
> fault and specifically the GNU date program. Here is a simplified version to
> reproduce the bug:
>
> script:
>
> #!/bin/sh
>
> echo NOW is `date`
> echo TODAY is `date +%Y%m%d`
> echo YESTERDAY is `date -d 'yesterday' +%Y%m%d`
> echo 30 DAYS AGO is `date -d '30 days ago' +%Y%m%d`
>
>
> output:
>
> address@hidden date 03090059; ./yesterday.sh
> Mon Mar 9 00:59:00 PDT 2015
> NOW is Mon Mar 9 00:59:00 PDT 2015
> TODAY is 20150309
> YESTERDAY is 20150307
> 30 DAYS AGO is 20150206
>
> address@hidden date 03090100; ./yesterday.sh
> Mon Mar 9 01:00:00 PDT 2015
> NOW is Mon Mar 9 01:00:00 PDT 2015
> TODAY is 20150309
> YESTERDAY is 20150308
> 30 DAYS AGO is 20150207
>
> GNU date version info:
>
> address@hidden 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.
>
> As you can see, the “yesterday” as well as the “30 days ago” calculation are
> one day off at 00:59, but correct a minute later.
>
> Cheers,
> Markus
>