bug-sh-utils
[Top][All Lists]
Advanced

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

Unexpected behaviour in date; calculates daylight savings time in correc


From: Karl Zaryski
Subject: Unexpected behaviour in date; calculates daylight savings time in correctly...
Date: Wed, 16 May 2001 13:36:04 -0400

Hello!  I may have found a bug in the GNU date.  I expected that the
following statements would give the same result:

                date ; date -d '01/01/1970 utc '`date +%s`' secs'

But the results are off by an hour:

                Wed May 16 12:38:31 EDT 2001
                Wed May 16 13:38:31 EDT 2001

I haven't delved into the source code for date (I'm no expert programmer)
but I suspect that the problem may be because I'm starting with a date out
of daylight savings time (start of epoch) and adding a number of seconds to
arrive at a result within daylight savings time... somewhere it adds the
extra hour.  I've worked out a workaround for my scripts, but it's a bit of
a kludge.

Is this a bug?  If not, can you explain this unexpected behaviour?



reply via email to

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