Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6231426
Votes 0
Synopsis incorrect time on certain dates under the EST5EDT timezone
Category java:classes_util_i18n
Reported Against
Release Fixed
State 11-Closed, duplicate of 5031170, bug
Priority: 4-Low
Related Bugs
Submit Date 21-FEB-2005
Description
OPERATING SYSTEM(S)
Solaris
FULL JDK VERSION(S):
1.3.1_13
DESCRIPTION:
Under the EST5EDT timezone, the 1.3.1 JDK returns incorrect time information for certain dates in periods when DST is active. One example is 08/01/1998.
The problem does not occur with the 1.4.2 JDK.
A testcase is provided at the end of this report. It compares the returned time with the expected time for 08/01/1998 in terms of the number of milliseconds elapsed since 01/01/1970. It can be run as follows:
    java DateTest 08/01/1998
Results for 1.3.1_13, with TZ=EST5EDT:
    Date entered = 08/01/1998, SQL Time =           901947600000
    Date entered = 08/01/1998, UTIL Time =          901947600000
    Expected Time result for 08/01/1998 :           901944000000
Results for 1.4.2_07 under identical conditions:
    Date entered = 08/01/1998, SQL Time =           901944000000
    Date entered = 08/01/1998, UTIL Time =          901944000000
    Expected Time result for 08/01/1998 :           901944000000
------ Start testcase DateTest.java ------
import java.util.*;
import java.text.*;
public class DateTest {
        public static void main ( String [] args ) {
                String enteredDate = args[0];
                String format = "MM/dd/yyyy";
                DateFormat df = new SimpleDateFormat(format);
                java.util.Date d = null;
                java.sql.Date date = null;
                df.setLenient(false);
                try {
                        d = df.parse(enteredDate);
                }
                catch (ParseException pe) {
                        throw new IllegalArgumentException(pe.getMessage());
                }
                date = new java.sql.Date(d.getTime());
                long dateTime = date.getTime();
                d = new java.util.Date(d.getTime());
                System.out.println("Date entered = "+enteredDate+", SQL Time = \t\t"+date.getTime());
                System.out.println("Date entered = "+enteredDate+", UTIL Time = \t\t"+d.getTime());
                System.out.println("Expected Time result for 08/01/1998 : \t\t901944000000");
        }
}
------ End testcase DateTest.java ------
  xxxxx@xxxxx   2005-2-21 16:38:26 GMT
Work Around
N/A
Evaluation
The symptom is not reproducible from 1.3.1_14. This should be a duplicate of 5031170.
  xxxxx@xxxxx   2005-2-23 10:04:26 GMT
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang