Closed eribul closed 4 years ago
Review: I agree in theory, although I think this is a rather complex issue. Rules for leap years are different depending on whether the year is divisible by 4, 100 and 400 for example, adding leap seconds makes it even more difficult. Also the week numbers are treated differently in differnt parts of the world (a year might have 53 weeks in some countries but only 52 in others). Further complexity might consider different time zones (including some regions with 30 minutes intervals, summer times etc). The lengt of the year is also differnt in differnt religions (although the christian/Gregorian calender migt be the norm). Althogehter, I think more comlicated time windows are better handled by dedicated date packages, which could be called by the user. A better approximation for the number of days of a year might be 365.241 (as advocated by some), but in this setting it does not really matter since time points were only recorded as dates (not time of day). I therfore leave this example as is.
The use of 365 days to indicate a year is not exact. Depending on the year, some dates could be missed due to leap years. I see that using windows in units of days is an easy coding solution here, but perhaps some more complex options for when time windows are specified in months or years, rather than days, could be supplied as well.