在 java 中,我如何在不同的语言环境中显示日期(例如俄语)。
最佳答案
类似于:
Locale locale = new Locale("ru","RU");
DateFormat full = DateFormat.getDateInstance(DateFormat.LONG, locale);
out.println(full.format(new Date()));
应该可以解决问题。但是,出现了Russian Date formatting in jdk1.5的问题。
The deal with Russian language is that month names have different suffix when they are presented stand-alone (i.e. in a list or something) and yet another one when they are part of a formatted date. So, even though March is "Март" in Russian, correctly formatted today's date would be: "7 Марта 2007 г."
Let's see how JDK formats today's date: 7 Март 2007 г. Clearly wrong.
关于java - Java中不同语言环境的日期显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/490679/