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

Dates incorrectly formatted for India locale

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.3.1
    • core-libs
    • sparc
    • solaris_8



      Name: dk106046 Date: 02/20/2004

      This problem occurs on SUN JDK 1.3.1. It does not occur with SUN JDK 1.4.1 (or above) or IBM JDKs 1.3.1/1.4.x.

      Upon running the testcase the sample outputs are as follows:

      IBM 1.3.1 and 1.4.1: SUN 1.3.1: SUN 1.4.1(and above):
      IN IN IN
      India India India
      English (India) English (India) English (India)
      IND IND IND
      d-MM-yy M/d/yy d/M/yy
      99,999,999 99,999,999 99,999,999

      Essentially the date format used in India is (Day/Month/Year) and on SUN 1.3.1 it shows up as M/d/yy which is INCORRECT.

      Testcase:
      ------------------------------------------------------------------------------------
      public class Test2{
            public static void main(String aa[]){
      try
      { Locale indLoca = new Locale("en", "IN");
      SimpleDateFormat sdf = (SimpleDateFormat)DateFormat.getDateInstance(DateFormat.SHORT, indLoca);
      String datePattern = sdf.toLocalizedPattern();
                        System.out.println(datePattern);
      } catch (Exception e)
      {
      }
      }
       }
      ------------------------------------------------------------------------------------
      ======================================================================

            peytoia Yuka Kamiya (Inactive)
            dkorbel David Korbel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: