- 
    Bug 
- 
    Resolution: Duplicate
- 
     P4 P4
- 
    None
- 
    5.0
- 
        generic
- 
        generic
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.
======================================================================
- duplicates
- 
                    JDK-4263805 (tz) need complete support of POSIX TZ syntax -           
- Closed
 
-