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

Canadian Date Format is incorrect

    XMLWordPrintable

Details

    • b21
    • 20
    • generic
    • generic

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10, OpenJdk 20

      A DESCRIPTION OF THE PROBLEM :
      When using the English(Canada) regional format on Windows, while extracting the date pattern by using the code below, the pattern is outputted as: M/d/yy.

      With previous versions of Java, Java 11 for example, the pattern output is: y-MM-dd.

      Code used to recreate:

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

      DateFormat defaultDateTimeFormat = (DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM));
      SimpleDateFormat sdFormatter = (SimpleDateFormat) defaultDateTimeFormat;
      String pattern = sdFormatter.toPattern();

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Pattern should be equal to y-MM-dd for Canada.
      ACTUAL -
      M/d/yy

      FREQUENCY : always


      Attachments

        Activity

          People

            naoto Naoto Sato
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: