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 PAPALto 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.

Comments
Is there a Visual Basic version for this?
Posted by RAG2 on 11/22/2009 11:07pmExcelllent!
Posted by Legacy on 12/21/2003 12:00amOriginally posted by: coderInCa
Excelllent!
Thank you.
-
ReplyNothing
Posted by karthi58 on 07/06/2009 06:19pmnothing to reply
ReplyWel done !
Posted by Legacy on 07/19/2003 12:00amOriginally posted by: sabit
Replyi got question for calculating time...
Posted by Legacy on 05/20/2003 12:00amOriginally posted by: Li
ReplyWhatever!
Posted by Legacy on 07/21/2002 12:00amOriginally posted by: Carol
ReplyThank you!
Posted by Legacy on 07/11/2002 12:00amOriginally 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.
ReplySeasons
Posted by Legacy on 06/19/2002 12:00amOriginally 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.
Reply15 minutes approximation
Posted by Legacy on 01/09/2002 12:00amOriginally 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.
ReplyI admit I lack information on how to avoid these inaccuracies. Any suggestions will be, of course, welcome.
Brilliant!
Posted by Legacy on 01/08/2002 12:00amOriginally posted by: Franco Gerevini
Nice job! Franco
Reply