Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Julian vs Gregorian Calendar

 
Pomchi Bedi
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow! Now we're getting into esoteric JavaLand! I'm impressed...
 
Pomchi Bedi
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic