Pavel Riha <[EMAIL PROTECTED]> 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, [EMAIL PROTECTED] 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." _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
