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)
{
}
}
}
------------------------------------------------------------------------------------
======================================================================