Does the Java calandar/date classes properly handle the loss of 10 days in the Gregorian calendar in October 1582?

William Kaufman

The docs say,

We implement the proleptic Julian and Gregorian calendars. This means we implement the modern definition of the calendar even though the historical usage differs. For example, if the Gregorian change is set to new Date(Long.MIN_VALUE), we have a pure Gregorian calendar which labels dates preceding the invention of the Gregorian calendar in 1582 as if the calendar existed then.
You could also try running,
    Calendar cal = Calendar.getInstance();
    cal.set(Calendar.YEAR,  1582);
    cal.set(Calendar.MONTH, Calendar.OCTOBER);
    cal.set(Calendar.DATE,  1);

      cal.add(Calendar.DATE, 1);
    while (cal.get(Calendar.MONTH) != Calendar.NOVEMBER);
and see what happens,...
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact