I fully realize that there is no one best way to do this but I am curious about the methods that folks use. The question is about when to roll to the next month. I can see several ways:
1) An array of day counts for each month, modifying the February value according to whether or not it is a leap year.
2) A lookup table, which is essentially an array
3) An if - else if - chain such as
if (month == 1) do something; else if (month == 2) do something; else if ....
4) Maybe there is some other scheme not yet divined?
The if/else if chain would seem to be easier to document and is arguably easier for some mythical second programmer to recognize. But, I suspect that it would lead to more code, though that is not a huge issue in my application.