bug-coreutils
[Top][All Lists]
Advanced

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

Re: "date -d '-X day' returning wrong day around StandardTime/DaylightTi


From: Eric Blake
Subject: Re: "date -d '-X day' returning wrong day around StandardTime/DaylightTime change-over
Date: Thu, 12 Mar 2009 18:48:03 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Philip Zimmerman (phzimmer) on 3/12/2009 9:10 AM:
> Hello,

Hello Philip,

> 
> I've noticed  a behavior of the 'date' utility as a result of the DST 
> change-over, and was wondering whether this is "expected behavior" or whether 
> this is a problem, so I'm inquiring whether anyone else has noticed this.

Yes.  In fact, so many people have noticed it that it is a FAQ:
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-command-is-not-working-right_002e

The issue at hand is that you are dealing with a 23 (or 25) hour day, so
calculations that add or subtract 24 hours will inherently put you 2
calendar days away.  It is not a bug, merely a misunderstanding of how the
tool works.  And changing the behavior to fit your desired needs will
break someone else who has grown accustomed to the current behavior.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkm5rUMACgkQ84KuGfSFAYAVxwCfSfogZTyfOSu9LW5t0jgOipzS
I+wAoLBabKEcgDm/Bb1RrZ0zbidrRX+u
=OD53
-----END PGP SIGNATURE-----




reply via email to

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