Java 支持儒略历吗?

Does Java support Julian calendar?(Java 支持儒略历吗?)

本文介绍了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改变日期.这是从 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 支持儒略历吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Java 支持儒略历吗?

基础教程推荐