File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Julian vs Gregorian Calendar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Julian vs Gregorian Calendar" Watch "Julian vs Gregorian Calendar" New topic

Julian vs Gregorian Calendar

Pomchi Bedi
Ranch Hand

Joined: Apr 03, 2001
Posts: 55
Hi All,
We all know that US and Britain switched to Gregorian calendar in 1752 and they dropped 11 days after Sep 2nd. But the Gregorian calendar provided by Sun/java uses 1582 as the change of year from Julian to Gragorian....dates before 1582 are Julian.
My problem is that for creating an application to be used by British and Americans I want to display September 1752 with 11 missing days, the same way as is done by unix.
Is there an easy way to do this??
Any suggestions are welcome.
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
It looks like the GregorianCalendar class has a nifty method,
public void setGregorianChange(Date date)
which allows you to override the default date of October 15, 1582. You should be able to set it to whatever date you feel is most appropriate for your application ...
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
Wow! Now we're getting into esoteric JavaLand! I'm impressed...

Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Pomchi Bedi
Ranch Hand

Joined: Apr 03, 2001
Posts: 55
Thanks for the reply!
I tried that and compared the day of the week returned for Sep 2nd & 14th 1752 with the unix calendar. The day for 2nd Sep was correct but for 14th if returned the incorrect day.
But may be this is the correct behaviour....I mean it returned me the day according to the Julian calendar. But what I want is, something that just simply removes the next 11 days after 2nd Sep 1752 and proceeds with the Gregorian calendar.
You know what I mean?? Suggestions??
I agree. Here's the link:
subject: Julian vs Gregorian Calendar
It's not a secret anymore!