Hi All,
I am using the following code to set the date as 14th Oct, 1582.
Code :
GregorianCalendar cal = new GregorianCalendar(1582, 9,14, 0, 0, 0);
System.out.println(cal.getTime());
OutPut :
Sun Oct 24 00:00:00 COT 1582
Is it possible to get the exact date what i am giving? Can you please
suggest me.
Thanks in advace.
Srinivas.
Matt Humphrey - 05 Dec 2007 14:42 GMT
> Hi All,
>
[quoted text clipped - 7 lines]
> Is it possible to get the exact date what i am giving? Can you please
> suggest me.
The Gregorian Calendar is only valid from Oct 15, 1582 onwards (depending on
local rules). The preceding Julian calendar ended on Oct 4th and there are
no intervening days. Java's GregorianCalendar allows you to go from one to
the other. In one sense Oct 14th doesn't exist in the same way that April
31st doesn't exist. However, because your date looks like a Julian date,
Java converts it to the next most meaningful Gregorian date--it's 10 days
after October 4th. See the Gregorian Calendar javadocs for details.
http://java.sun.com/javase/6/docs/api/
http://en.wikipedia.org/wiki/Gregorian_calendar
Matt Humphrey http://www.iviz.com/
>14th Oct, 1582.
see http://mindprod.com/jgloss/missingdays.html

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com