This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Julian vs Gregorian Calendar" Watch "Julian vs Gregorian Calendar" New topic
Author

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.
Thanks
Pomchi
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: 804
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??
Thanks
Pomchi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Julian vs Gregorian Calendar
 
Similar Threads
Calculating historical dates
[help] any code to convert YYYYMMDD to Julian Date?
Paid Vacation
Issue with java.util.Calendar in java1.5 & above
Oracle is Catholic!