This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Programming Diversions and the fly likes Calculating historical dates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Calculating historical dates" Watch "Calculating historical dates" New topic

Calculating historical dates

Stuart Lord

Joined: Oct 27, 2006
Posts: 27
Very briefly, are there any java classes which can calculate dates prior to 1 January 1970 and also 1752?

The latter year was that in which the Julian calendar changed over to the Gregorian one (in most of Europe) - the length of the year was more closely defined to be 365 days, 5 hours, 48 minutes and 46 seconds. Before it was given as 365 days and 6 hours.

Under the new definition the 'leap day' was lost on the centennial year (double leap year) unless that year was completely devisable by 400. If so then it kept its leap year status. This all meant that in October of 1752, 13 days were lost to account for the 13 double leap years that had elapsed since Christian calendars were first drawn up. This caused traders to riot in the streets of European cities, as they thought that they were losing precious days of work...!
[ June 30, 2008: Message edited by: Stuart Lord ]
Paul Clapham

Joined: Oct 14, 2005
Posts: 19851

Looks like java.util.GregorianCalendar does. Have a look at its API documentation, it looks like most of the points you addressed are covered.
Stuart Lord

Joined: Oct 27, 2006
Posts: 27
Paul - Thanks for your help, I'll be interested to find out what the API says vis-a-vis the GregorianCalendar class.
I agree. Here's the link:
subject: Calculating historical dates
It's not a secret anymore!