Article View: borland.public.jbuilder.java.api
Article #1185Probelem with Date and daylight savings
From: Hanan Hermon
Date: Wed, 24 Apr 2002 09:39
Date: Wed, 24 Apr 2002 09:39
22 lines
1507 bytes
1507 bytes
Hi,
I'm using the following code:
System.out.println(""+new Date());
Surprisingly the output is not correct. ( if the time is 10:00 then the
output is 11:00 ).
I'm sure that the problem has something to do with daylight savings because
when
I changed my computer date to January it worked fine.
When looking at the toString() method of Date object I saw that it use the
default TimeZone,
and I did not find a way to disable the use of daylight from the TimeZone
object.
Is there a way to disable the daylight savings ? if so how ?
Thanks in advance,
Hanan Hermon,
Technical Details
Message-ID:
<3cc66f49_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!supernews.com!194.159.246.34.MISMATCH!kibo.news.demon.net!demon!newsfeed.media.kyoto-u.ac.jp!out.nntp.be!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,78729ebe20306c09,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-04-24 01:42:04 PST From: "Hanan Hermon" <hananh@radcom.co.il> Newsgroups: borland.public.jbuilder.java.api Subject: Probelem with Date and daylight savings Date: Wed, 24 Apr 2002 11:39:54 +0200 Lines: 24 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: <3cc66f49_2@dnews> X-Trace: dnews 1019637577 192.116.176.125 (24 Apr 2002 01:39:37 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!supernews.com!194.159.246.34.MISMATCH!kibo.news.demon.net!demon!newsfeed.media.kyoto-u.ac.jp!out.nntp.be!propagator-SanJose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews