微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Java是否支持Julian日历?

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

原文地址:https://www.jb51.cc/java/122520.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐