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

SimpleDateFormat yy-MMM-dd formats September as Sept

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Is a problem in 17, works in jdk-10.0.1.jdk, not sure when the problem arose

      A DESCRIPTION OF THE PROBLEM :
      Working output

      Incorrect output

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See test case

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      14-9-2022
      14-09-2022
      14-Sep-2022
      14-September-2022
      14-8-2022
      14-08-2022
      14-Aug-2022
      14-August-2022
      14-7-2022
      14-07-2022
      14-Jul-2022
      14-July-2022
      14-6-2022
      14-06-2022
      14-Jun-2022
      14-June-2022
      14-5-2022
      14-05-2022
      14-May-2022
      14-May-2022
      14-4-2022
      14-04-2022
      14-Apr-2022
      14-April-2022
      14-3-2022
      14-03-2022
      14-Mar-2022
      14-March-2022
      14-2-2022
      14-02-2022
      14-Feb-2022
      14-February-2022
      14-1-2022
      14-01-2022
      14-Jan-2022
      14-January-2022
      14-12-2021
      14-12-2021
      14-Dec-2021
      14-December-2021
      14-11-2021
      14-11-2021
      14-Nov-2021
      14-November-2021
      14-10-2021
      14-10-2021
      14-Oct-2021
      14-October-2021

      ACTUAL -

      14-9-2022
      14-09-2022
      14-Sept-2022
      14-September-2022
      14-8-2022
      14-08-2022
      14-Aug-2022
      14-August-2022
      14-7-2022
      14-07-2022
      14-Jul-2022
      14-July-2022
      14-6-2022
      14-06-2022
      14-Jun-2022
      14-June-2022
      14-5-2022
      14-05-2022
      14-May-2022
      14-May-2022
      14-4-2022
      14-04-2022
      14-Apr-2022
      14-April-2022
      14-3-2022
      14-03-2022
      14-Mar-2022
      14-March-2022
      14-2-2022
      14-02-2022
      14-Feb-2022
      14-February-2022
      14-1-2022
      14-01-2022
      14-Jan-2022
      14-January-2022
      14-12-2021
      14-12-2021
      14-Dec-2021
      14-December-2021
      14-11-2021
      14-11-2021
      14-Nov-2021
      14-November-2021
      14-10-2021
      14-10-2021
      14-Oct-2021
      14-October-2021


      ---------- BEGIN SOURCE ----------
      Test case

      import java.text.SimpleDateFormat;
      import java.util.Calendar;
      import java.util.Date;
      import java.util.GregorianCalendar;

      class SDFTest {

      private static final SimpleDateFormat sdfddMMMyyyy = new SimpleDateFormat("dd-MMM-yyyy");
      private static final SimpleDateFormat sdfddMMMMyyyy = new SimpleDateFormat("dd-MMMM-yyyy");
      private static final SimpleDateFormat sdfddMMyyyy = new SimpleDateFormat("dd-MM-yyyy");
      private static final SimpleDateFormat sdfddMyyyy = new SimpleDateFormat("dd-M-yyyy");

      public static void main(String[] args) {

      GregorianCalendar cal = new GregorianCalendar();
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Non, with recoding zillions of programs to add a check for Sep/Sept grrrrr

      FREQUENCY : always


            tongwan Andrew Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: