Redian新闻
>
user.region or default locale question
avatar
user.region or default locale question# Java - 爪哇娇娃
m*s
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
avatar
c*s
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

avatar
f*h
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。