bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in daylight-saving?


From: Andreas Schwab
Subject: Re: bug in daylight-saving?
Date: Tue, 29 Mar 2005 12:14:07 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux)

Pavel Riha <address@hidden> writes:

> #info date
>>When a relative item causes the resulting date to cross a boundary
>>where the clocks were adjusted, typically for daylight-saving time,
>>the resulting date and time are adjusted accordingly.
>
> I use `date -d yesterday +%F` in my shell script to obtain the day of
> yesterday. The script is run in 0:00 every day for backup logs.
>
> today (2005-03-28 0:00) there was a problem, that it returned 2005-03-26 !
> instead of 2005-03-27
>
> I think, it is because of the time change (27.3. was the daylight-saving
> day).
>
> according to the info page (see above), it should be bug.

"date -d yesterday" is the same as "date -d '24 hours ago'", thus since
the day before 2005-03-28 had only 23 hours this is perfectly reasonable.
To avoid any problems with DST use something like "date -d '12:00 yesterday'".

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]