Equinox and Solstice Calculation

Environment: VC6

Here is a little programme I wrote to calculate the date and time of equinoxes and solstices in a given year (not earlier than 4713 BC). Actually I am no astronomer: I have only collected information on calendars and astronomical calculations from various sources on the Internet and assembled what I needed.

The included public domain time routine converts Julian Day Numbers to Gregorian and Julian calendar dates. Julian Day Numbers (JDN) are used by astronomers as a date/time measure independent of calendars and convenient for computing the elapsed time between dates. The JDN for any date/time is the number of days (including fractional days) elapsed since noon, 1 Jan 4713 BC. Julian Day Numbers were originated by Joseph Scaliger in 1582 and named after his father Julius, not after Julius Caesar. They are not related to the Julian calendar.

Years BC are given as negative numbers. Note that there is no year 0 BC; the day before 1 Jan 1 AD is 31 Dec 1 BC. Note also that 1 BC, 5 BC, etc. are leap years.

Pope Gregory XIII decreed that the Julian calendar would end on 4 Oct 1582 AD and that the next day would be 15 Oct 1582 in the Gregorian Calendar. The only other change is that centesimal years (years ending in 00) would no longer be leap years unless divisible by 400. Britain and its possessions and colonies continued to use the Julian calendar up until 2 Sep 1752, when the next day became 14 Sep 1752 in the Gregorian Calendar. This routine can be compiled to use either convention. By default, as I am Italian and Roman Catholic, Pope Gregory's convention is used. Simply comment out

#define PAPAL
to use British convention.

This programme uses formulae taken from Jean Meeus's "Astronomical Algorithms" (1991). CalculateDate() function is based on formulae originally posted by Tom Van Flandern Washington, DC metares@well.sf.ca.us in the UseNet newsgroup sci.astro. Reposted 14 May 1991 in FidoNet C Echo conference by Paul Schlyter (Stockholm). Minor corrections and additional information on JDNs and calendars by Raymond Gardner Englewood, Colorado.

Downloads

Download demo project - 136 kB


Comments

  • Is there a Visual Basic version for this?

    Posted by RAG2 on 11/22/2009 11:07pm

    I'd find "Equinox and Solstice" calculation very useful, but I have VB6 and VB 2008, not VC6. Is there a Visual Basic version of the season-calculating algorithm? How difficult is it to convert it to VB?

    Reply
  • Excelllent!

    Posted by Legacy on 12/21/2003 12:00am

    Originally posted by: coderInCa

    Excelllent!


    Thank you.

    • Nothing

      Posted by karthi58 on 07/06/2009 06:19pm

      nothing to reply

      Reply
    Reply
  • Wel done !

    Posted by Legacy on 07/19/2003 12:00am

    Originally posted by: sabit

    Wel done,
    

    Reply
  • i got question for calculating time...

    Posted by Legacy on 05/20/2003 12:00am

    Originally posted by: Li

    do you have any program for initialize the time start from zero. eg: (00:00:00), then after press the "start" button, it will start counting the time by second.
    
    

    plz send the example to my email.
    thanks in advance.

    my email: zgleelee@yahoo.com

    Reply
  • Whatever!

    Posted by Legacy on 07/21/2002 12:00am

    Originally posted by: Carol

    Great work - Now can we please have 2003!
    

    Reply
  • Thank you!

    Posted by Legacy on 07/11/2002 12:00am

    Originally posted by: Mike

    Thank you so much for sharing your work. My limited understanding of C++ was sufficient to allow me to adapt your code to a DLL that was easily accesible to my Visual Basic calendar program. You saved me hours of work.

    Reply
  • Seasons

    Posted by Legacy on 06/19/2002 12:00am

    Originally posted by: Paul Stevenson

    The calculator is great but as someone from the Southern Hemisphere all the labels are backward for us down here. It would be less "northern-hemispherocentric" if qualified by a note to the effect that it was for your hemisphere. On Friday we will celebrate mid-winters day on your summer solstice.

    Reply
  • 15 minutes approximation

    Posted by Legacy on 01/09/2002 12:00am

    Originally posted by: Vernero Cifagni

    As you may have seen in the source files, the CalculateDate() conversion routine is intrinsically accurate to only about 15 minutes for years around 2000 CE. I think it might depend on the algorithm itself. Maybe it has something to do with the fact that the times calculated by this programme are ephemeris times (see http://infoplease.com/ce5/CE017077.html). To get an estimate of GMT to within about fifteen minutes adjust by the appropriate value of delta-T (which is currently about one minute, so no modification is needed for years in the 20th or 21st centuries - see http://user.online.be/felixverbelen/dt.htm). For dates around 1 CE actual times GMT may have been about three hours earlier than the times given.
    I admit I lack information on how to avoid these inaccuracies. Any suggestions will be, of course, welcome.

    Reply
  • Brilliant!

    Posted by Legacy on 01/08/2002 12:00am

    Originally posted by: Franco Gerevini

    Nice job! Franco

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • On-demand Event Event Date: September 10, 2014 Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …

  • Packaged application development teams frequently operate with limited testing environments due to time and labor constraints. By virtualizing the entire application stack, packaged application development teams can deliver business results faster, at higher quality, and with lower risk.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds