JDK-4066690 : TimeZone class reports Hawaii has daylight savings time, it doesn't
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 1.1.4
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1997-07-23
  • Updated: 1997-10-23
  • Resolved: 1997-10-23
Related Reports
Duplicate :  
Relates :  
Description
java.util.TimeZone reports that Hawaii-Aleutian standard time, ID: HST, has a daylight time offset.  It does not.  It is -10 hours offset from GMT (UTC).


Steps to reproduce:
Compile and execute the following code:

import java.io.PrintStream;
import javasoft.sqe.harness.Status;
import javasoft.sqe.harness.Test;

import java.util.TimeZone;

public class ZoneTester implements Test {

    public static void main( String argv[] ) {
        ZoneTester test = new ZoneTester();
        Status status = test.run( argv, System.err, System.out );
        status.exit();
    }

    public Status run( String argv[], PrintStream log, PrintStream out ) {
        boolean expectedResult = false;
        String timeZoneID = "HST";
        int i;

        for( i = 0; i < argv.length - 1; ++i ) {
            if( argv[i].equals( "-Expected" ) ) {
                expectedResult = new Boolean( argv[++i] ).booleanValue();
            }
            else if( argv[i].equals( "-TimeZoneID" ) ) {
                timeZoneID = argv[++i];
            }
        }
        
        TimeZone testTimeZone = TimeZone.getTimeZone( timeZoneID );
        out.println( "Testing time zone: " + testTimeZone.getID() );
        if( testTimeZone.useDaylightTime( ) != expectedResult ) {
            return Status.failed( "Expected: " + expectedResult + 
                                  " received: " + 
                                  testTimeZone.useDaylightTime( ) );
        }
        else {
            return Status.passed( "OKAY" );
        }
    }
}


Comments
PUBLIC COMMENTS java.util.TimeZone reports that Hawaii-Aleutian standard time, ID: HST, has a daylight time offset. It does not. It is -10 hours offset from GMT (UTC).
10-06-2004