JDK-4059578 : java.util.Date always returns PDT & getTimezoneOffset() is behaving strangely.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.1.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1997-06-18
  • Updated: 1998-03-02
  • Resolved: 1998-03-02
Related Reports
Duplicate :  
Description

Name: tb29552			Date: 06/17/97


Regardless of what the current time/timezone is set to on
my computer, java.util.Date returns Pacific Daylight Time.
I have been unable to return the actual time (Central European
Time) at all. Also, notice the return value of getTimezoneOffset()
in the below code.

...

public static void main(String argv[]) {
  Date now = new Date();

  System.out.println("Now: " + now);
  System.out.println("TimezoneOffset: " + now.getTimezoneOffset() / 60);
}

The above returns (at 2:25pm CET on June 16):
  Now: Mon Jun 16 05:21:34 PDT 1997
  TimezoneOffset: -1

Shouldn't the TimezoneOffset be +1 for CET??
company - UI Design AB , email - ###@###.###
======================================================================

Comments
WORK AROUND Name: tb29552 Date: 06/17/97 ======================================================================
11-06-2004