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

SimpleDateFormat.format() always shows time and time zones as PDT

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • None
    • 1.1.2
    • core-libs
    • x86
    • windows_nt

    Description



      Name: sgC58550 Date: 06/06/97


      Even though the local machine is configured for EDT, the
      SimpleDateFormat class always seems to use PDT:

      public class Testit
      {

        public static void main(String[] args)
        {

          SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy 'at' hh:mm:ss a zzz");
          Date currentTime_1 = new Date();
          String dateString = formatter.format(currentTime_1);

          System.out.println("dateString is: " + dateString);
          System.out.println("currentTime_1 is: " + currentTime_1);

        } // End of method

      } // End of class

      The output produced by the above code is:

      dateString is: 06/05/1997 at 08:14:35 AM PDT
      currentTime_1 is: Thu Jun 05 11:14:35 EDT 1997

      The formats should differ, but the date, time, and time zone
      should be the same.
      company - TRC , email -
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              ssenthilsunw Shanmugam Senthil (Inactive)
              sgoodsunw Sheri Good (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: