JDK-4976874 : TimeZone.getDefault() should reflect startDayOfWeek and endDayOfWeek of TZ
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2004-01-12
  • Updated: 2004-01-13
  • Resolved: 2004-01-13
Related Reports
Duplicate :  
Description

Name: dk106046			Date: 01/12/2004

The problem reported is that the TimeZone.getDefault() doesn't reflect the rules part (startDayOfWeek and endDayOfWeek) of the TZ environmental variable.

Please find below a small testcase which displays the default timezone information.

import java.util.*;
public class test {
        public static void main(String args[]) {
                System.out.println( "\nJava default Timezone=" +
                           TimeZone.getDefault() );

	System.out.println("\n Java date=" +
                                (new java.util.Date()) );
       }
}

A sample run is as follows:

$export TZ=NZST-12NZDT,M10.1.0,M3.3.1
$ 
$ java test                           

Java default Timezone=java.util.SimpleTimeZone[id=Pacific/Auckland,offset=43200000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=9,startDay=1,startDayOfWeek=1,startTime=7200000,startTimeMode=1,endMode=3,endMonth=2,endDay=15,endDayOfWeek=1,endTime=7200000,endTimeMode=1]

Java date=Wed Jan 07 22:45:36 NZDT 2004
$ 

Notice that the startdayofweek/EnddayofWeek do not reflect that in the TZ env variable.

======================================================================

Comments
EVALUATION The full POSIX TZ syntax hasn't been supported yet. Closing this bug report as a duplicate of 4263805. ###@###.### 2004-01-13
13-01-2004