Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4066690

TimeZone class reports Hawaii has daylight savings time, it doesn't

    XMLWordPrintable

Details

    • generic
    • generic

    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" );
              }
          }
      }

      Attachments

        Issue Links

          Activity

            People

              ssenthilsunw Shanmugam Senthil (Inactive)
              kasmithsunw Kevin Smith (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: