bug-coreutils
[Top][All Lists]
Advanced

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

Re: date problem


From: Eric Blake
Subject: Re: date problem
Date: Mon, 30 Mar 2009 06:01:42 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

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

According to Heiko Schlichting on 3/30/2009 3:29 AM:
> Hi,
> 
> I read FAQ 24 ("The date command is not working right") but the following
> problem is not what I expect on the day after daylight saving time starts.
> All the outputs are done at epoch 1238364060, timezone Europe/Berlin using
> coreutils 7.1. This is one minute after midnight on the day after day light
> saving starts.

> 
> Problem! This is 24 hours subtracted but not what is expected as "yesterday
> at the same time of the day".

You diagnosed things perfectly - 'yesterday' subtracts 24 hours, even when
the previous day was a 23-hour day due to daylight savings.  This behavior
is documented, and there is no choice we can make that will fit everyone's
needs (similar things happen if you subtract or add a 30-day 'month' but
in the context of a 28-day or 31-day calendar segment).  Both choices
(figure out whether the adjustment falls over a special-case boundary, to
affect only one calendar unit, vs. always treat a relative date as a fixed
length of time without regards to special cases) have their users, and at
this point, existing scripts depend on the existing choice.  So all we can
suggest is to avoid special times (compute 'yesterday' relative to noon,
not one minute after midnight; compute 'last month' relative to the 15th,
not the first).

If you have a suggestion on how to improve the FAQ, we are all ears.

- --
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

iEYEARECAAYFAknQtKYACgkQ84KuGfSFAYAWeACdFjkT4DwCTBCGU5Ff1PROoVhc
gdYAn2mBcgdyNz2YBbgsuoy7AVXJMeCQ
=w/WE
-----END PGP SIGNATURE-----




reply via email to

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