-
Bug
-
Resolution: Fixed
-
P3
-
1.3.1_04
-
None
-
018
-
sparc
-
solaris_8
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2117881 | 1.3.1_11 | Yumin Qi | P3 | Resolved | Fixed | 11 |
JDK-2117880 | 1.2.2_18 | Yumin Qi | P3 | Resolved | Fixed | 18 |
Oracle engineering have found a problem with the Sun JVM or API's that cause the time to be incorrect for some timezones when the date is in BC. This impacts their application server product.
In our testing all versions tested 1.3.1_09 and before exhibit this problem. All versions tested 1.4.0_FCS and later do not exhibit this problem. While Oracle have identified this problem against java.sql.TimeStamp it's superclass java.util.Date also exhibits this problem.
This simple test case demonstrates the problem:
import java.sql.SQLException;
public class test2 {
static public void main(String args[]) throws SQLException {
java.sql.Timestamp ts = new java.sql.Timestamp(-6611, 0, 1, 0, 0, 0, 0);
System.out.println("ts.toString() "+ ts.toString());
}
}
Then compile and run with timezone set specifically in the environment:
$ javac test2.java
$ export TZ=Australia/Queensland
$ java test2
The results were as follows:
Results from a US based machine with default TZ US/Pacifiic are:
JDK version TZ Result
------------------------------------------------------------------
1.2.2 US/Pacific 4712-01-01 00:00:00.0
1.2.2 Australia/Queensland 4712-12-31 23:00:00.0 (*)
1.2.2 Australia/Melbourne 4712-01-01 00:00:00.0
1.3 US/Pacific 4712-01-01 00:00:00.0
1.3 Australia/Queensland 4712-12-31 23:00:00.0 (*)
1.3 Australia/Melbourne 4712-01-01 00:00:00.0
1.3.1 US/Pacific 4712-01-01 00:00:00.0
1.3.1 Australia/Queensland 4712-01-01 00:00:00.0
1.3.1 Australia/Melbourne 4712-12-31 23:00:00.0 (*)
1.4 US/Pacific 4712-01-01 00:00:00.0
1.4 Australia/Queensland 4712-01-01 00:00:00.0
1.4 Australia/Melbourne 4712-01-01 00:00:00.0
(*) => incorrect
In our testing all versions tested 1.3.1_09 and before exhibit this problem. All versions tested 1.4.0_FCS and later do not exhibit this problem. While Oracle have identified this problem against java.sql.TimeStamp it's superclass java.util.Date also exhibits this problem.
This simple test case demonstrates the problem:
import java.sql.SQLException;
public class test2 {
static public void main(String args[]) throws SQLException {
java.sql.Timestamp ts = new java.sql.Timestamp(-6611, 0, 1, 0, 0, 0, 0);
System.out.println("ts.toString() "+ ts.toString());
}
}
Then compile and run with timezone set specifically in the environment:
$ javac test2.java
$ export TZ=Australia/Queensland
$ java test2
The results were as follows:
Results from a US based machine with default TZ US/Pacifiic are:
JDK version TZ Result
------------------------------------------------------------------
1.2.2 US/Pacific 4712-01-01 00:00:00.0
1.2.2 Australia/Queensland 4712-12-31 23:00:00.0 (*)
1.2.2 Australia/Melbourne 4712-01-01 00:00:00.0
1.3 US/Pacific 4712-01-01 00:00:00.0
1.3 Australia/Queensland 4712-12-31 23:00:00.0 (*)
1.3 Australia/Melbourne 4712-01-01 00:00:00.0
1.3.1 US/Pacific 4712-01-01 00:00:00.0
1.3.1 Australia/Queensland 4712-01-01 00:00:00.0
1.3.1 Australia/Melbourne 4712-12-31 23:00:00.0 (*)
1.4 US/Pacific 4712-01-01 00:00:00.0
1.4 Australia/Queensland 4712-01-01 00:00:00.0
1.4 Australia/Melbourne 4712-01-01 00:00:00.0
(*) => incorrect
- backported by
-
JDK-2117880 java.sql.TimeStamp results in wrong time for some timezones when dates are in BC
- Resolved
-
JDK-2117881 java.sql.TimeStamp results in wrong time for some timezones when dates are in BC
- Resolved
- relates to
-
JDK-5031170 1.3.1_11 only: GregorianCalendar uses wrong ERA value in non-lenient mode
- Resolved
-
JDK-8064685 [TEST_BUG] Test java/sql/TimeStamp/4953991/test.java fails for JDK 5u81b06 in Solaris
- Resolved