JDK-4844459 : setTimeInMillis adding an extra hour as default
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.4.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-04-07
  • Updated: 2003-05-06
  • Resolved: 2003-05-06
Related Reports
Duplicate :  
Relates :  
Description

Name: jl125535			Date: 04/07/2003


FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
The method Calendar.setTimeInMillis() when called is
automatically adding 1 hour onto the stored time.

I am using timezone GMT (London).

REGRESSION.  Last worked in version 1.3.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Write some code to use the setTimeInMillis method
2. call setTimeInMillis with a value
3. print out the set calendar time and note the time is
wrong.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected the time to called to be set.
Actual the time is an hour ahead.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.util.Calendar;

public class TestProblem {
  public static void main(String args[]) {
    GregorianCalendar cal = new GregorianCalendar();
    cal.clear();
    cal.setTimeInMillis(3600050);
    System.out.println("time="
        + new java.text.SimpleDateFormat( "kk:mm:ss" ).format( cal.getTime()));
  }
}
---------- END SOURCE ----------
(Review ID: 166905) 
======================================================================

Comments
EVALUATION Looks like a duplicate of 4832236. But I need to know the time zone in which the test program was run. Could the submitter please provide the time zone information? ###@###.### 2003-04-08 Closing this bug report as a duplicate of 4255109. (This bug track system doesn't allow this bug report to be closed as a duplicate of 4832236.) ###@###.### 2003-05-06
06-05-2003