This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Daylight saving issue. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Daylight saving issue." Watch "Daylight saving issue." New topic

Daylight saving issue.

Abhilash Boinapally

Joined: Jun 13, 2006
Posts: 8
In our project there is one shift time from 18 to 2 am as this is a dst transition time we are facing a peculiar problem.On reaching 1.59 am on march 11 the time should become 3 am (as 2 am is virtually not there) but in my application it showing 1 am ie 2 am is becoming 1 am.our tool is using jdk 1.3.1 version.

when i checked sun portal

Why does the 1.3.1 JDK version not transition into or out of DST settings at the correct hour?
There is a known limitation with the 1.3.1 JDK in relation to it calculating the correct time for entering and exiting DST transitions. This behavior has been present since 1.3.1 FCS. It has been corrected in 1.4 and in later JDK versions when the time zone framework was re-coded. The limitation arises from complexities in determining whether a given timestamp is in standard or daylight time savings rules. As a result, transition times can be out of range by one hour on the night of a transition.
For example, given a system with the time zone "America/New_York", you would see the following behavior:
Entering DST:

$/jdk/j2sdk1_3_1/bin/java DSTTest "3/11/2007 2:00 AM"
Sun Mar 11 01:00:00 EST 2007 *Currently not in daylight-savings time.
$/jdk/j2sdk1_3_1/bin/java DSTTest "3/11/2007 3:00 AM"
Sun Mar 11 03:00:00 EDT 2007 *Currently in daylight-savings time.Exiting DST:

$/jdk/j2sdk1_3_1/bin/java DSTTest "11/04/2007 12:59 AM"
Sun Nov 04 00:59:00 EDT 2007 *Currently in daylight-savings time.
$/jdk/j2sdk1_3_1/bin/java DSTTest "11/04/2007 01:00 AM"
Sun Nov 04 01:00:00 EST 2007 *Currently not in daylight-savings time.

so its a bug.How to solve this issue.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

I'm not sure this would help, but can you check the following page :

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: Daylight saving issue.
It's not a secret anymore!