Skip to content

Calculations of years and months wrong due to leap years #156

@IDisposable

Description

@IDisposable

The constants used for milliseconds in a year and milliseconds in a month are incorrect because they are computed from the slightly naïve understanding of leap days in the Gregorian calendar.

A leap day occurs every four years. However, because that's actually slightly too often, if the year is divisible by 100 then it is not a leap year. However, because that would be too infrequent, if the year is divisible by 400 they it is a leap year.

Thus the correct decimal representation of the average length of a year is 365.2425 days. Likewise, since the year is 12 exact months, an average length of a month is 30.436875 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions