m****s 发帖数: 9 | 1 I am running windows XP.
I just wrote a simple clien testing SimpleDateFormat.
I defined the format to be "MMM dd yyyy" which should take in letters for
month and digits for day and year. When I call the parse method with "Oct 19
2003" it actually failed on parseException.
After a few searches around, it might be related to user.region or default
locale problem. mine for some reason is set to user.region=cn.
Does anyone know how to change it within XP(not in java code) to us?
thanks a lot |
c******s 发帖数: 8 | 2 what's the exception details? it should work I believe.
【在 m****s 的大作中提到】 : I am running windows XP. : I just wrote a simple clien testing SimpleDateFormat. : I defined the format to be "MMM dd yyyy" which should take in letters for : month and digits for day and year. When I call the parse method with "Oct 19 : 2003" it actually failed on parseException. : After a few searches around, it might be related to user.region or default : locale problem. mine for some reason is set to user.region=cn. : Does anyone know how to change it within XP(not in java code) to us? : thanks a lot
|
f********h 发帖数: 149 | 3 I believe you can just pass it to java as java -Duser.region=whatever_you_want
【在 m****s 的大作中提到】 : I am running windows XP. : I just wrote a simple clien testing SimpleDateFormat. : I defined the format to be "MMM dd yyyy" which should take in letters for : month and digits for day and year. When I call the parse method with "Oct 19 : 2003" it actually failed on parseException. : After a few searches around, it might be related to user.region or default : locale problem. mine for some reason is set to user.region=cn. : Does anyone know how to change it within XP(not in java code) to us? : thanks a lot
|