JMM
2004-08-24 15:16:19 UTC
I'm having issues dealing with Locale under 1.4.1_03-b02. The problem
seems to be with the Java Runtime having problems reading the system
locale. My system locale is set to UK, but when I run a test program
(code below) I get the date formatted to a US locale instead of UK. I
ran the same program under 1.4.2_03 on win xp, and 1.4.2_04-b05 on
win2k which both worked fine. Running the same program under 1.4.1_03
on win xp and win 2k results in the problem. Does anyone know of a
workaround to this problem without upgrading to 1.4.2_03 or higher?
Also does anyone know what the minimum version we should have if we
did decide to upgrade JRE's?
Thanks,
Jonathan
import java.util.*;
import java.text.*;
public class LocaleTest
{
public static void main(String[] args)
{
DateFormat format = DateFormat.getDateInstanc(DateFormat.SHORT);
format.setCalendar(Calendar.getInstance());
format.getCalendar().set(Calendar.MILLISECOND,0);
format.getCalendar().set(Calendar.SECOND,0);
format.getCalendar().set(Calendar.MINUTE,0);
format.getCalendar().set(Calendar.HOUR,0);
System.out.println("date is "+
format.format(format.getCalendar().getTime()));
}
}
seems to be with the Java Runtime having problems reading the system
locale. My system locale is set to UK, but when I run a test program
(code below) I get the date formatted to a US locale instead of UK. I
ran the same program under 1.4.2_03 on win xp, and 1.4.2_04-b05 on
win2k which both worked fine. Running the same program under 1.4.1_03
on win xp and win 2k results in the problem. Does anyone know of a
workaround to this problem without upgrading to 1.4.2_03 or higher?
Also does anyone know what the minimum version we should have if we
did decide to upgrade JRE's?
Thanks,
Jonathan
import java.util.*;
import java.text.*;
public class LocaleTest
{
public static void main(String[] args)
{
DateFormat format = DateFormat.getDateInstanc(DateFormat.SHORT);
format.setCalendar(Calendar.getInstance());
format.getCalendar().set(Calendar.MILLISECOND,0);
format.getCalendar().set(Calendar.SECOND,0);
format.getCalendar().set(Calendar.MINUTE,0);
format.getCalendar().set(Calendar.HOUR,0);
System.out.println("date is "+
format.format(format.getCalendar().getTime()));
}
}