3 ms·
A little pressed with time, but does it handle leap years properly? Since every year divisible by 100 is not a leap year, unless it is also divisible by 400? (
by fifilura 2y ago
A little pressed with time, but does it handle leap years properly? Since every year divisible by 100 is not a leap year, unless it is also divisible by 400?
(E.g. 1900 is not a leap year but 2000 is)
- ColinWright 2y agoThere is a small correction needed for January and February in leap years, and I haven't included the corrections for pre-1900. The Carroll method does deal with these issues and I have internalised them, but I find I never use them, so I retain only the simpler version.
- OscarCunningham 2y agoOne simple way to do January and February is to treat them as part of the previous year (with an adjustment for the constant you remember for those months).