java - Java中不同语言环境的日期显示?

标签 java

在 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/

相关文章:

java - 从 "slow"和 "head"之间的排序链表关系中删除重复项

java - 正则表达式用两个点分隔的部分提取主题标签

java - 优化重复数组分配

java - 由 : java. lang.ClassNotFoundException : org. springframework.context.event.EventListenerFactory - Spring Batch 引起

java - 如何将字符串的多个部分放入列表中?

Java BigDecimal 的舍入问题和计算

Java(Swing)监听按键事件

java - 使用 lockoninsert=false 的集群模式下的 Quartz

java - 线程 "main"org.openqa.selenium.WebDriverException : permission denied 中出现异常

java - 查找具有完全相同属性的元素