JDK-4105412 : TimeZone.getDefault() behavior not as documented
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.1.6,1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6,windows_95
  • CPU: x86,sparc
  • Submitted: 1998-01-21
  • Updated: 1998-03-02
  • Resolved: 1998-03-02
Related Reports
Duplicate :  
Duplicate :  
Description

Name: dgC58589			Date: 01/21/98


This program returns "time zone = GMT   offset=0" when I'm in Colorado.

import java.util.TimeZone ;
public class tzbug
{
public static void main(String args[]) throws Exception 
{
TimeZone tz = TimeZone.getDefault() ;
System.out.println("time zone = " + tz.getID() + "   offset=" + tz.getRawOffset()) ;
}
}

   Documentation for Java.util.TimeZone says :

Typically, you get a TimeZone using getDefault which creates a TimeZone based on the time zone where the program is running. For example, for a program running in Japan, getDefault creates a TimeZone object based on Japanese Standard Time. 

   which implies that java should get MDT from the system.
(Review ID: 23541)
======================================================================

Comments
WORK AROUND Name: dgC58589 Date: 01/21/98 <heavy sigh....> ======================================================================
11-06-2004