-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
beta
-
generic, sparc
-
generic, solaris_7
-
Verified
Even though a time zone does not observe DST, "getDSTSavings()" is returning a non-zero value.
After discussing further with other I18N SQE, it was felt that this can be confusing to a user. Though the user does have "useDaylightTime()" to figure out whether the time zone observes DST, having "getDSTSavings()" return a contradicting value is inconsistent.
Here's a quick program to demonstrate this:
----------------------------- Cut Here --------------------------
import java.util.*;
public class GetDSTSavingsTest {
SimpleTimeZone stz;
public GetDSTSavingsTest() {
stz = (SimpleTimeZone)TimeZone.getTimeZone("Asia/Tokyo");
System.out.println("Observes daylight savings time? " +
stz.useDaylightTime());
System.out.println("Daylight savings time value(should be 0 if not " +
"observed): " + stz.getDSTSavings());
}
public static void main(String[] args) {
new GetDSTSavingsTest();
}
}
----------------------------- Cut Here --------------------------
edmund.lou@eng 1999-12-17
After discussing further with other I18N SQE, it was felt that this can be confusing to a user. Though the user does have "useDaylightTime()" to figure out whether the time zone observes DST, having "getDSTSavings()" return a contradicting value is inconsistent.
Here's a quick program to demonstrate this:
----------------------------- Cut Here --------------------------
import java.util.*;
public class GetDSTSavingsTest {
SimpleTimeZone stz;
public GetDSTSavingsTest() {
stz = (SimpleTimeZone)TimeZone.getTimeZone("Asia/Tokyo");
System.out.println("Observes daylight savings time? " +
stz.useDaylightTime());
System.out.println("Daylight savings time value(should be 0 if not " +
"observed): " + stz.getDSTSavings());
}
public static void main(String[] args) {
new GetDSTSavingsTest();
}
}
----------------------------- Cut Here --------------------------
edmund.lou@eng 1999-12-17
- duplicates
-
JDK-4352315 SimpleTimeZone.getDSTSavings() returning 3600000 for TZs not using DaylightSavin
-
- Closed
-
- relates to
-
JDK-4401148 ClassCastException when casting from TimeZone to SimpleTimeZone
-
- Closed
-
-
JDK-4687253 REGRESSION: SimpleTimeZone.getDSTSavings() always returns 0
-
- Closed
-