Article View: borland.public.jbuilder.java.api
Article #1011TimeZone bug on WinNT with JDK 1.3.1
From: Hanan Hermon
Date: Sun, 28 Apr 2002 14:56
Date: Sun, 28 Apr 2002 14:56
31 lines
1893 bytes
1893 bytes
Hi,
If change the system Time Zone definition (On WinNT JDK 1.3.1)
while my application is running then when I create and print a new date
it display the time using the old time zone.
When I looked at the code I saw that the date object is using the TimeZone
object
to convert it to a string. My guess is that the java application does not
receive (or handle)
a message that the time zone was change.
Is there a way to overcome that problem ?
I'm using the following code and I do not see any change in the output
of the application when I change the time zone definition (The time on my
computer is changed):
static public void main(String[] args)
{
while (true)
{
try
{
Thread.sleep(1000);
}
catch ( InterruptedException e )
{
}
System.out.println(""+new Date());
}
}
Technical Details
Message-ID:
<3ccc0004$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news-out.visi.com!hermes.visi.com!out.nntp.be!propagator2-SanJose!propagator-SanJose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,d811d2fc70c0079,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-04-28 07:02:32 PST From: "Hanan Hermon" <hananh@radcom.co.il> Newsgroups: borland.public.jbuilder.java.api Subject: TimeZone bug on WinNT with JDK 1.3.1 Date: Sun, 28 Apr 2002 16:56:38 +0200 Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: 192.116.176.125 Message-ID: <3ccc0004$1_1@dnews> X-Trace: dnews 1020002308 192.116.176.125 (28 Apr 2002 06:58:28 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news-out.visi.com!hermes.visi.com!out.nntp.be!propagator2-SanJose!propagator-SanJose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews