Regaurding GregorianCalendar

  • Thread starter srinivas.veeranki
  • Start date
S

srinivas.veeranki

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
 
S

srinivas.veeranki

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

Matt Humphrey

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.

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top