I remember the epoch. I was around to watch. It was in fact at 1.00am, not midnight, because we had summer time (daylight saving time) all winter that year. It was pretty unpleasant, so in1971 we went back to GMT in winter.Stephan van Hulst wrote:Probably because your default time zone is an hour ahead of Greenwich mean time. . . .
Mike Simmons wrote:Daylight savings certainly can be used inside the toString() method of Date - but any time zone labeled as GMT has absolutely no business using daylight savings time. Ever. So something is pretty screwed up there in how the JDK is printing the localized time.
Campbell Ritchie wrote:It was not called GMT, but BST = British Standard Time, back then.
Thu Jan 01 01:00:00 CET 1970
1970-01-01 00:00:00 GMT (+0000)
1970-01-01 00:00:00 UTC (+0000)
Campbell Ritchie wrote:
I remember the epoch. I was around to watch. It was in fact at 1.00am, not midnight, because we had summer time (daylight saving time) all winter that year. It was pretty unpleasant, so in1971 we went back to GMT in winter.Stephan van Hulst wrote:Probably because your default time zone is an hour ahead of Greenwich mean time. . . .
Jesper de Jong wrote:Indeed strange that the hour is off by one while the time zone is GMT.
I tried the following on my system (JDK 1.7.0 update 3, 64-bit, on Ubuntu 11.10):
Output exactly as I'd expect (my local time zone is CET):
Thu Jan 01 01:00:00 CET 1970
1970-01-01 00:00:00 GMT (+0000)
1970-01-01 00:00:00 UTC (+0000)
1970-01-01 00:00:00 +00:00 (+0000)
Half and half. If you were in a GMT area (Britain) the epoch fell at 1.00am. In other places, eg parts of Africa, which are in the GMT zone, it would have been at midnight. The fact that you are showing GMT might suggest an error. I managed to get 1.00am from System.out.println(new Date(0L)); so the behaviour is at least reproducible; that would appear to be the same as what Jesper did. Whether our having summer time all winter in 1970 is the explanation, I am not sure. It does say midnight here.Guy Hayward wrote: . . .
Apologies for being thick, but is this an explanation for the Date(0) being an hour wrong, or is it just banter?
. . .
Poop goes in a willow feeder. Wipe with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|