Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4125892

Implementation Error: GregorianCalendar

    XMLWordPrintable

Details

    • 1.2beta4
    • x86
    • windows_95
    • Not verified

    Description



      Name: el35337 Date: 04/04/98


      In both 1.2beta and 1.1.5, the method GregorianCalendar.isLeapYear()
      returns false for all years before 45 BCE. A look at the class's code shows
      that the behavior is intentional (it was the behavior suggested in bug report
      4051768), but it's wrong.

      While it's true that the Julian calendar wasn't introduced until that
      year, one does not get the pre-Julian calendar merely by omitting the leap
      year. The Roman republican calendar was entirely different. Many of the
      months were of different lengths than they are now, and it employed a leap
      month inserted at irregular intervals. Because this calendar is not
      reconstructable by formula, historians and astronomers both adopt the
      convention of projecting the Julian calendar back proleptically.

      The formula used internally to convert between time and the year-month-day
      fields uses this proleptic julian calendar, so for dates before
      JULIAN_ONSET, you will have years that have a February 29, but all functions
      and fields that depend on isLeapYear(), e.g. Calendar.DAYOFYEAR, will
      be incorrect.
      (Review ID: 27737)
      ======================================================================

      Attachments

        Activity

          People

            aliusunw Alan Liu (Inactive)
            elarsen Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: