bug-coreutils
[Top][All Lists]
Advanced

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

Re: date and UTC and GMT odd behaviour


From: Mike 'Mike' Jones
Subject: Re: date and UTC and GMT odd behaviour
Date: Tue, 23 Aug 2005 18:27:18 +0100 (BST)


Yep, I tried the same on a SuSE 8.2 machine with version 4.5.8 in Germany
and I get the correct behaviour. Unfortunately it's the only SuSE machine I have access to! However, on a machine in the USA running Red Hat WS release 3 and data version 4.5.3, I also see the correct behaviour.

So, could it be that /etc/localtime is influencing the behaviour?

... In fact moving /etc/localtime out of the way I get the correct behaviour so I guess this is the route of the problem:
specifically /usr/share/zoneinfo/Europe/London on my system!

/usr/share/zoneinfo/Europe/Belfast (which is a different file but the same time zone) also suffers from this problem. Paris on the other hand does not.

Copying /usr/share/zoneinfo/Europe/London from the SuSE machine in Germany and using it on my machine reproduces the problem. So I guess it's an Linux OS distribution independent bug.

Humph!

Thanks,
Mike



On Tue, 23 Aug 2005, Andreas Schwab wrote:

"Mike 'Mike' Jones" <address@hidden> writes:

A little bit of trial-and-error and I find that the anomaly is limited to
between 6pm, 23 Jun 1968 GMT and 2am, 31 Oct 1971:

$ date -d "Sat Oct 31 01:59:59 UTC 1971" +%s
57722399
$ date -d "Sat Oct 31 01:59:59 GMT 1971" +%s
57718799

$ date -d "Sat Oct 31 02:00:00 UTC 1971" +%s
57722400
$ date -d "Sat Oct 31 02:00:00 GMT 1971" +%s
57722400

and

$ date -d "Sun Jun 23 18:00:00 UTC 1968" +%s
-48060000
$ date -d "Sun Jun 23 18:00:00 GMT 1968" +%s
-48063600

$ date -d "Sun Jun 23 17:59:59 UTC 1968" +%s
-48060001
$ date -d "Sun Jun 23 17:59:59 GMT 1968" +%s
-48060001

I can't reproduce that here.  I get the same (correct) output whether I
use UTC or GMT.

This means that using:
$ date -d "Tue Jan 01 00:00:00 GMT 1970 + NNNNN seconds"

Better use date -d "@NNNNNN".

Andreas.



--
http://www.sve.man.ac.uk/General/Staff/jonesM/




reply via email to

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