I assume you have a set of serial date conversion library subroutines? Gods bless Zeller.
(Serial date is sometimes misnamed Julian Date. Zeller's Congruence is named after the mathematician who noticed that if you start the year with March and end it in February, it's easier to calculate dates because there are 30.6 days per month and you just round off to get the appropriate whole number of days. Example, rounding off you get 31 days for March; 30.6x2 = 61.2 = 61 for March+April, and so on. The nice thing about that is you can work it in reverse... you still need to do the 365.25 days per year calculation, but once you've determined the start of the year - that is, March 1 - you can divide by 30.6, add a fudge factor and round down to get the number of months, and so on.)
While I looked around at my possibilities
I assume you have a set of serial date conversion library subroutines? Gods bless Zeller.
(Serial date is sometimes misnamed Julian Date. Zeller's Congruence is named after the mathematician who noticed that if you start the year with March and end it in February, it's easier to calculate dates because there are 30.6 days per month and you just round off to get the appropriate whole number of days. Example, rounding off you get 31 days for March; 30.6x2 = 61.2 = 61 for March+April, and so on. The nice thing about that is you can work it in reverse... you still need to do the 365.25 days per year calculation, but once you've determined the start of the year - that is, March 1 - you can divide by 30.6, add a fudge factor and round down to get the number of months, and so on.)