Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2007

Tip: Looking for answers? Try searching our database.

Regaurding GregorianCalendar

Thread view: 
srinivas.veeranki@gmail.com - 05 Dec 2007 14:12 GMT
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
srinivas.veeranki@gmail.com - 05 Dec 2007 14:13 GMT
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/
Roedy Green - 06 Dec 2007 10:10 GMT
>14th Oct, 1582.

see http://mindprod.com/jgloss/missingdays.html
Signature

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.