Military utility tools / Length of service
Length of service
Two dates in, exact interval out. Or one date plus a period, and the resulting date.
Applied to the From date.
Set the inputs, then work it out.
Length--years, months, days
Total days--inclusive of start
Decimal years--
Total months--completed
Total weeks--
Resulting date--after the period added
That is a--day of the week
Days until then--from today
Does this handle leap years?
Yes, throughout. All arithmetic runs in UTC on real calendar dates, so leap days are counted where they occur.
Why is the total days figure different from years times 365?
Because of leap days, and because months vary in length. The decimal years figure divides by 365.2425, the mean Gregorian year, which is the right divisor for long periods.