Oracle 文档 http://docs.oracle.com/javase/6/docs/technotes/guides/intl/calendar.doc.html 声明 Java 支持 3 种日历系统:公历、日本帝国和泰国佛教.Java 是否支持儒略历?
Oracle docs http://docs.oracle.com/javase/6/docs/technotes/guides/intl/calendar.doc.html states that Java supports 3 calendar systems: Gregorian, Japanese Imperial and Thai Buddhist. Does Java support Julian calendar?
是的.
来自 GregorianCalendar 的文档:
From the doc of GregorianCalendar:
GregorianCalendar 是一种混合日历,同时支持儒略历和公历系统,支持单一不连续性,默认情况下对应于公历日期公历开始制定(1582 年 10 月 15 日)国家,后来在其他国家).截止日期可能会由调用者通过调用 setGregorianChange().
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) 设置 GregorianCalendar改变日期.这是从 Julian 转换到发生公历日期.默认值为 1582 年 10 月 15 日(公历).在此之前,日期将采用儒略历.获得一个纯儒略历,将更改日期设置为 Date(Long.MAX_VALUE).到获取纯公历,将更改日期设置为日期(Long.MIN_VALUE).
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 支持儒略历吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
解析 ISO 8601 字符串本地日期时间,就像在 UTC 中Parsing an ISO 8601 string local date-time as if in UTC(解析 ISO 8601 字符串本地日期时间,就像在 UTC 中一样)
如何将公历字符串转换为公历?How to convert Gregorian string to Gregorian Calendar?(如何将公历字符串转换为公历?)
Java:GregorianCalendar 的最大值和最小值是什么/在哪Java: What/where are the maximum and minimum values of a GregorianCalendar?(Java:GregorianCalendar 的最大值和最小值是什么/在哪里?)
1582 年 10 月 15 日之前日期的日历到日期转换.公历Calendar to Date conversion for dates before 15 Oct 1582. Gregorian to Julian calendar switch(1582 年 10 月 15 日之前日期的日历到日期转换
java日历setFirstDayOfWeek不起作用java Calendar setFirstDayOfWeek not working(java日历setFirstDayOfWeek不起作用)
Java:获取当前星期几的值Java: getting current Day of the Week value(Java:获取当前星期几的值)