🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7867

Re: Problem with time zones ...

#7867
From: Edwin G�nthner
Date: Thu, 10 May 2001 06:27
34 lines
2239 bytes
Hi John,

>It would help if you would tell us in which way it fails.  Does it 
>throw an exception?  Print out incorrect results?  Crash your hard 
>drive?   :o)

First it killed my dog then it screw up my television set ...

No, the only problem is that it print outs incorrect results. ;-)
Code is quite simple:

Date date = new Date();
System.out.println(myFormatter.format(date));

On my machine, it gives me the correct time,
on the other machine, it gives me correct time + one hour.

I assume that Java ignores this one flag ("change according to 
daylight saving times automatically") that you can setup in 
Windows Date settings.

If I switch of this feature on my machine, the Windows clock will
show me "correct time - one hour". I assume that Java always takes this
time and adds one hour. Correct for my machine, but not correct
if you switch off the windows flag and tell your machine the exact time
(meaning: the user changes the clock  if daylight saving time changes - and not
the system).

Maybe a table makes it more clear:

                  actual time       windows time (internal)     windows external        Java
my machine   10:00                9:00                             9 + 1 -> 10:00        9+1-> 10:00
customer        10:00              10:00                           10 + 0 -> 10:00     10+1 -> 11.00
Technical Details
Message-ID: <3afa34d2$1_1@dnews>
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3af7da0f$1_2@dnews> <MPG.1562bdeacce5495b98a1b2@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,a59c8cd977ce05a
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-05-09 23:38:08 PST
From: "Edwin G�nthner" <egu@compart.net>
Sender: "Edwin G�nthner" <egu@compart.net>
Reply-To: "Edwin G�nthner" <egu@compart.net>
Subject: Re: Problem with time zones ...
Newsgroups: borland.public.jbuilder.java.language
X-User-Info: 195.177.17.18 195.177.17.18    
References: <3af7da0f$1_2@dnews>  <MPG.1562bdeacce5495b98a1b2@forums.borland.com> 
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3afa34d2$1_1@dnews>
Date: 9 May 2001 23:27:30 -0700
X-Trace: dnews 989476050 207.105.83.65 (9 May 2001 23:27:30 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews