java - Java 支持儒略历吗?

标签 java calendar

Oracle 文档 http://docs.oracle.com/javase/6/docs/technotes/guides/intl/calendar.doc.html声明 Java 支持 3 种日历系统:公历、日本帝国和泰国佛教。 Java 支持儒略历吗?

最佳答案

是的,确实如此。

来自 GregorianCalendar 的文档:

GregorianCalendar is a hybrid calendar that supports both the Julian and Gregorian calendar systems with the support of a single discontinuity, which corresponds by default to the Gregorian date when the Gregorian calendar was instituted (October 15, 1582 in some countries, later in others). The cutover date may be changed by the caller by calling setGregorianChange().

使用setGregorianChange 来改变它。

public void setGregorianChange(Date date) Sets the GregorianCalendar change date. This is the point when the switch from Julian dates to Gregorian dates occurred. Default is October 15, 1582 (Gregorian). Previous to this, dates will be in the Julian calendar. To obtain a pure Julian calendar, set the change date to Date(Long.MAX_VALUE). To obtain a pure Gregorian calendar, set the change date to Date(Long.MIN_VALUE).

关于java - Java 支持儒略历吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13569542/

相关文章:

java - 从 Java 中的 PEM 格式文件中提取多个 X.509 证书

java - 一个java代码在两台不同的电脑上表现不同

Java 导入语句

java - 我的 KeyBindings 不起作用,我想知道为什么

Java StampedLock : what happens to writer while someone is reading

java - 使用 Java Swing 显示日历

java - Android - 使用 NotificationListener 服务接收日历提醒通知

android - 日历不返回 GMT

iphone:如何像 NSCalendar 一样混合枚举

asp.net - 如何在日历中选择多个日期并将其显示在标签中