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

Calendar.getTime() returns time GMT + 3.5 hours.

    XMLWordPrintable

Details

    Description

      Problem
      -------

      Calendar.getTime() returns time GMT + 3.5 hours.

      With the Solaris 2.6 shell variable set to MET the attached code
      segment will produce a result that is 3.5 hours ahead of the GMT
      time.

      Code Example
      ------------

      import java.util.*;
      import java.io.PrintStream;

      public class dt
      {
          Calendar calendar;

          public dt()
          {

              calendar = Calendar.getInstance();
              calendar.setLenient(false);
              System.out.println( calendar.getTime() + "\n");
          }

          public static void main(String astring[])
          {
              new dt();
          }
      }


      To Reproduce
      ------------

      SPARC Solaris 2.6 FCS - No patches installed.

      SunSoft JDK 1.1.4

      java full version "Solaris_JDK_1.1.4_01_pre-release1"

      Set the environment variable TZ set to the string "MET".

      Install either JDK releases from above.


      Run, date and the resulting Java application and you will see:

      date ; java dt
      Wed Jan 28 09:00:00 MET 1998
      Wed Jan 28 11:30:01 GMT+03:30 1998

      the actual dates may vary, but the offsets will be relative.

      The above test was done at 08:00:00 GMT.

      Attachments

        Issue Links

          Activity

            People

              aliusunw Alan Liu (Inactive)
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: