# Equinox and Solstice Calculation

### WEBINAR:On-demand webcast

How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017

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.

• #### 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?`

• #### 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

• #### Wel done !

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

Originally posted by: sabit

```Wel done,
```

• #### 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.

my email: zgleelee@yahoo.com
```

• #### Whatever!

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

Originally posted by: Carol

```Great work - Now can we please have 2003!
```

• #### 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.

• #### 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.

• #### 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.

• #### Brilliant!

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

Originally posted by: Franco Gerevini

Nice job! Franco

• You must have javascript enabled in order to post comments.

## Top White Papers and Webcasts

• As all sorts of data becomes available for storage, analysis and retrieval - so called 'Big Data' - there are potentially huge benefits, but equally huge challenges...
• The agile organization needs knowledge to act on, quickly and effectively. Though many organizations are clamouring for "Big Data", not nearly as many know what to do with it...
• Cloud-based integration solutions can be confusing. Adding to the confusion are the multiple ways IT departments can deliver such integration...

## Most Popular Programming Stories

• There have been no articles posted today.