• Post Reply Bookmark Topic Watch Topic
  • New Topic

SimpleDateFormat and locale  RSS feed

 
Lester Tam
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i have problem in using SimpleDateFormat.

The code:
//------------------------------------------------------------------------
DateFormat df = new SimpleDateFormat("yy/DD/MM hh:mm");
try{
startTime = df.parse("04/30/06 10:30");
System.out.print ("Date: " + startTime)
}catch(ParseException e){
throw new IllegalArgumentException("Can't parse Start date");
}
//-------------------------------------------------------------------------
this code works fine when im using eng win2k and system locale = chinese taiwan.

but when i change the system locale to Thai, it shows the year is 2046, but my system clock still display 2004.


Please Help
Thanks
Lester
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I got 1961, when I changed my locale setting to Thai... I think it's becos of the different usage of year in Thai Calendar...
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Intermediate forum...
 
Lester Tam
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i fix it?
im doing a schedular tools and need it work it Thai Locale.

thanks
 
Lester Tam
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok finally i find out why, This year(2004) is 2547 in Thai.

but i dont know how to make sure my SimpleTimeFormat can always read the standard year not the system local
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!