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

DateTimeFormatter incorrectly formatting short month and day for en_AU locale

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      issue has been replicated on mac OS X on the following
      ---------
      java 11 2018-09-25
      Java(TM) SE Runtime Environment 18.9 (build 11+28)
      Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)

      ------------------------------------------------

      openjdk 10.0.2 2018-07-17
      OpenJDK Runtime Environment Zulu10.3+5 (build 10.0.2+13)
      OpenJDK 64-Bit Server VM Zulu10.3+5 (build 10.0.2+13, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      DateTimeFormatter
      for symbols "E" and "MMM" in pattern i.e:

      DateTimeFormatter.ofPattern("E d MMM yyyy", locale)

      Incorrectly adding periods (".") after the short month and day when using the Australia locale en_AU

      Expected Output: "Mon 15 Oct 2018"

      Actual Output: "Mon. 15 Oct. 2018"


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Locale aus = new Locale.Builder().setLanguage("en").setRegion("AU").build();

      DateTimeFormatter dtf = java.time.format.DateTimeFormatter.ofPattern("E d MMM yyyy", aus);

      LocalDate date = LocalDate.now();

      date.format(dtf);


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      "Mon 15 Oct 2018"
      ACTUAL -
      "Mon. 15 Oct. 2018"

      FREQUENCY : always


            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: