Formulas and sources
Each formula this calculator uses, where it comes from, and what it leaves out. "How it works" shows the same formula with your own numbers.
Duration
Duration mode
- Duration
- years, then months, then days between the dates
- End Date
- the second date
- Start Date
- the first date
Total Days is the end date minus the start date, so January 1 to January 2 is 1 day. When a month has no matching day, that month is complete on the 1st of the next month: January 31 to March 1 is 1 month and 0 days. Total Weeks counts whole weeks, and Total Hours is the days × 24.
Source: Uses the Gregorian calendar as the JavaScript and HTML standards define it [1][2]. The month-end rule is CalcTrail's own, the one the Age Calculator uses. Total Days leaves out the start date and counts the end date, as the Federal Rules of Civil Procedure count a period of days before their weekend rule [3].
Working days
Business Days mode
- Working Days
- the days in the range that are neither weekend days nor holidays
- Days in Range
- every date from the start to the end, both counted
- Weekends
- Saturdays and Sundays
- Holidays
- weekdays that are holidays: US federal holidays when you exclude them, and your own dates
A federal holiday on a Saturday is counted on the Friday before, and one on a Sunday on the Monday after, as for most federal employees.
Source: Uses the eleven legal public holidays of 5 U.S.C. 6103 [4], on the days OPM lists them as observed [5]. The dates used here match OPM's published 2026, 2027 and 2028 schedules.
Adding time to a date
Add/Subtract mode, when adding
- Final Date
- the date reached
- Start Date
- the date you start from
- Duration
- the years, months and days you enter
Years and months are applied first, then days. A date past the end of a shorter month stops on that month's last day: January 31 + 1 month is February 28 (29 in a leap year).
Source: The month-end rule is the one the OpenDocument standard sets for EDATE [6].
Subtracting time from a date
Add/Subtract mode, when subtracting
Same symbols as above, counted back: March 31, 2026 − 1 month is February 28.
Source: The month-end rule is OpenDocument's EDATE rule [6].
Sources
- Ecma International. ECMA-262, ECMAScript 2026 Language Specification, §21.4.1.1 Time Values and Time Range, and §21.4.1.5 DaysInYear. 17th edition, June 2026.
- WHATWG. HTML Living Standard, §2.3.5 Dates and times. Living Standard, read October 5, 2026.
- U.S. Government Publishing Office. United States Code, Title 28, Appendix, Federal Rules of Civil Procedure, Rule 6: Computing and Extending Time; Time for Motion Papers, Rule 6(a)(1). 2024 edition.
- U.S. Government Publishing Office. United States Code, Title 5, Section 6103: Holidays, subsections (a) and (b)(1). 2024 edition.
- U.S. Office of Personnel Management. Federal Holidays, the 2026, 2027 and 2028 schedules. Undated page, read October 5, 2026.
- OASIS. Open Document Format for Office Applications (OpenDocument) Version 1.3, Part 4: Recalculated Formula (OpenFormula) Format, §6.10.8 EDATE. OASIS Standard, April 2021.
What this calculator does not cover
- Holiday exclusion covers the eleven US federal holidays, on the days they are observed, and any dates you add. It does not include Inauguration Day, state or local holidays, company closures or other countries' holidays unless you add them.
- It does not apply a court's or agency's deadline rules, such as moving a deadline off a weekend or holiday.
- Dates before a country adopted the Gregorian calendar are read as Gregorian dates.
- It counts whole days. For hours and minutes within a day, see the Time Calculator.
Sources checked on .