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

TimeZone.getDefault() fails for EST time zone in Australia

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.3.0
    • 2.0.1, 1.1.7
    • core-libs
    • kestrel
    • sparc
    • solaris_2.6, solaris_7

      I've included a simple test case below. Apparently, Australia also has a time zone know as "EST", the same id used for the US Eastern Standard Time. When an app needs to display a date/time value in Australia's "EST", it displays the date/time using the US "EST".

      import java.util.*;
      import java.text.*;

      class Test {
          public static void main(String[] args) {
              SimpleDateFormat fm = new SimpleDateFormat("MMM d HH:mm:ss");
              fm.setTimeZone(TimeZone.getDefault());
              System.out.println("Date/time is: " + fm.format(new Date()));
          }
      }

            duke J. Duke
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: