有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (4) 个答案

  1. # 1 楼答案

    人们不使用java。util。日历很多。事实上,当JSR-310结束时,现在已经在一个名为“joda time”的图书馆中的东西很快就会取代它Joda Time also has a Julian calendar

    只要将joda时间作为依赖项添加到您的项目中,您就可以离开了

  2. # 2 楼答案

    是的

    从Gregorianalendar的文件中:

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