The code below outputs “Japan Standard Time”.
TimeZone tz = TimeZone.getTimeZone("Asia/Tokyo");
Locale locale = new Locale("ja_JP");
System.out.println(tz.getDisplayName(locale));
I am expecting it to output something with Kanji along the lines of “日本標準時”. It does not seem to matter what timezone ID or locale I pass to getDisplayName()–the resulting text is always English. How do I get the localized values?
I am using Sun Java SDK/JRE version 1.6.0_18. I also tried running the tzupdater utility but got no change in results.
It works if you use the predefined
JAPANlocale:At least, it print a bunch of questions marks on my console, rather than “Japan Standard Time”, which has to be a good sign.
Locale.JAPANis defined asnew Locale("ja_JP_", "ja", "JP"), so there’s clearly some subtlety here in the constructor arguments.