• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with Gregorian Calendar BC Date

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a BC Date in Gregorian Calendar,if the year is leap year
i am not able to store the date 29 for month of February,
if i am trying to store '29-2-2004' for BC date it is conveting
in to '1-3-2004', this is not the problem for AD dates,for AD dates it is
working fine,the problem is only with BC Dates,can anyone clear this for me
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since this doesn't have anything to do with Swing/JFC/AWT GUI stuff, I'm moving this post to the Java In General - Intermediate forum.

Also, the reason for this is probably due to the fact that to calculate a leap year in the present, future, or recent past all you need is the formula that a leap year is a year divisable by 4, but not 100, unless it is also divisible by 400. However, if you go far into the past, you also have to apply historical knowledge that doesn't follow a formula. Prior to October 15, 1582 dates you get from the GregorianCalendar class will actually use the Julian calendar instead. The Julian calendar also has leap years, and they are (were?) calculated similarly to the Gregorian calendar. However, the concept of the leap year was only introduced in 46 BC, and there's a gap between 9 BC and 8 AD due to making up for miscalculations early on. (Most of this information was gleaned from this page.)

So, 2004 BC would not be a leap year because leap years did not exist at that point. (err.. well... at least as a concept.)
 
reply
    Bookmark Topic Watch Topic
  • New Topic