I've seen mentioned here that OpenSRS tracks expirations by the second.
I'm wondering how you guys handle leap years and such.

For example, I'm pondering ways to create a billing system for my domains
and clients.  Seconds seems like a good measure, but how do I measure a
month?  since some a 31 days and some are 30.. I could keep a table, and
multiply 60 * 60 * 24 * (28|29|30|31).  Plus, how do you handle leap years?
Do you make every year 365.25 days or do you just add 1 day every 4 years?

with no leap year, 1 month is 30.4166666666667 days

on a leap year, 1 month is 30.5 days

if a year is 365.25 days, a month becomes 30.4375 days

How do you guys cope with these issues?


Reply via email to