加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

Java是否支持Julian日历?

发布时间:2020-12-14 05:26:44 所属栏目:Java 来源:网络整理
导读:Oracle docs http://docs.oracle.com/javase/6/docs/technotes/guides/intl/calendar.doc.html声称Java支持3个日历系统:Gregorian,Japanese Imperial和Thai Buddhist. Java是否支持Julian日历? 解决方法 是的,它确实. 来自GregorianCalendar的文档: Grego
Oracle docs http://docs.oracle.com/javase/6/docs/technotes/guides/intl/calendar.doc.html声称Java支持3个日历系统:Gregorian,Japanese Imperial和Thai Buddhist. Java是否支持Julian日历?

解决方法

是的,它确实.

来自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).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读