Java是否支持儒略历? [英] Does Java support Julian calendar?

查看:238
本文介绍了Java是否支持儒略历?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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
的更改日期。这是从儒略历转换为公历
的时候。默认值为1582年10月15日(格雷戈里安)。
在此之前,日期将在儒略历中。若要获取
纯Julian日历,请将更改日期设置为Date(Long.MAX_VALUE)。要使
获得纯阳历,请将更改日期设置为
Date(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是否支持儒略历?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆