About DateMath
Date and time math, done in your browser
DateMath is a set of free date and time calculators that add or subtract days, weeks, months and years, count calendar and business days between dates, work out durations, hours worked, exact age and ISO week numbers, and count down to any date, holiday or length of time in your browser.
How DateMath counts
- Days between two dates
- The difference between the dates: the days after the start date up to and including the end date. A checkbox counts both ends where both the first and the last day count, as for a trip or an event.
- Adding months and years
- The result keeps the start's day number. When the target month is shorter, it is moved to that month's last day, so January 31 plus one month is February 28, or 29 in a leap year. Spreadsheet functions such as Excel's EDATE do the same.
- Ages and durations
- Whole calendar months are counted first, then the remaining days (and, for durations, hours and minutes). Adding the result back to the start always lands on the end.
- Business days
- Monday to Friday, without the US federal holidays of 5 U.S.C. 6103. A holiday on a Saturday is observed on the Friday before and one on a Sunday on the Monday after, the rule for federal employees.
- Hours worked
- The end time minus the start time; an end earlier than the start is on the next day, so a night shift needs no date. Only the unpaid break you enter is taken off, a week is the sum of its exact minutes, and decimal hours are minutes divided by 60, rounded to two places at the end.
- Times
- Dates and times are calendar dates and clock times without a time zone, so a link gives everyone the same answer. Daylight saving changes are not applied.
- Countdowns
- A countdown subtracts the current time on your device from the moment your clock will show the target date and time, so it reaches zero then, in your own time zone. The time left is real time, so a daylight saving change in between adds or takes away its hour instead of making the count jump. The countdown timer measures a length of time against the clock, so it stays exact in a background tab.
Why DateMath's answers are right
You can check every answer DateMath gives: it follows published standards, handles the cases where calculators most often disagree by a stated rule, and is tested against answers worked out by hand.
The standards DateMath follows
- The Gregorian calendar. DateMath treats every date as a Gregorian date, with its leap-year rule: a year divisible by 4 is a leap year, except century years not divisible by 400, so 2000 had a February 29 and 2100 will not. Source: Gregorian calendar.
- ISO 8601 week dates. DateMath numbers weeks by ISO 8601: weeks start on Monday, week 1 is the week with the year's first Thursday, and a year has 52 or 53 weeks. Source: ISO 8601.
- US federal holidays. DateMath skips the 11 annual holidays of 5 U.S.C. 6103 on the days they are observed for federal employees, as the US Office of Personnel Management (OPM) lists them: a Saturday holiday on the Friday before, a Sunday holiday on the Monday after. Source: 5 U.S.C. 6103, OPM federal holidays.
- US hours-worked rules. DateMath counts exact minutes and subtracts only the breaks you enter. The federal Fair Labor Standards Act rules count rest breaks of about 5 to 20 minutes as work time but not bona fide meal periods (ordinarily 30 minutes or more), and allow rounding clock times to the nearest 5 minutes, tenth or quarter of an hour only if employees are still paid for all the time they work. Source: 29 CFR 785.18, 29 CFR 785.19, 29 CFR 785.48.
- Your device's local time. DateMath's countdowns read the current time from your device and count to the target in your own time zone. In the US, the standard time zones are set by 15 U.S.C. 261 and daylight saving time by 15 U.S.C. 260a (from 2:00 AM on the second Sunday in March to 2:00 AM on the first Sunday in November); your device applies them. Source: 15 U.S.C. 261, 15 U.S.C. 260a.
The edge cases DateMath handles
- Month ends: When the target month is shorter, DateMath moves to its last day: January 31 plus one month is February 28, or 29 in a leap year, and March 31 minus one month is February 28.
- Leap days: Every count that crosses a February 29 includes it, 1900 had none, and a February 29 birthday is counted on February 28 in common years.
- Holidays on weekends: A Saturday New Year's Day is observed on December 31 of the year before, so DateMath skips that Friday in the old year's count.
- Holidays added by law: Juneteenth is counted from 2021 and Martin Luther King Jr. Day from 1986, the years they were first observed.
- Weeks across New Year: January 1 to 3 can belong to ISO week 52 or 53 of the year before, and December 29 to 31 to week 1 of the next year.
- Times past midnight: 8:00 PM plus 8 hours is 4:00 AM the next day, and 90 minutes or 36 hours roll over into the next unit.
- Night shifts: An end time earlier than the start is on the next day, so 10:00 PM to 6:30 AM is 8 hours 30 minutes worked, never a negative number.
- Decimal hours: Decimal hours are minutes divided by 60, so 7 hours 18 minutes is 7.3 hours, not 7.18, and DateMath adds exact minutes before it rounds.
- Spans that run backward: When the end is before the start, DateMath gives a negative count instead of an error.
- Daylight saving: The calculators' times are clock times without a time zone, so a shared link gives everyone the same answer. DateMath doesn't add or remove the hour the clocks move, and the time and duration pages say how that changes the real elapsed time.
- Countdowns and time zones: A countdown ends when your own clock shows the target, so a New Year countdown reaches zero at your local midnight, and a shared countdown counts to the same clock time in each viewer's zone. The time left is real time: it never jumps when the clocks change, and across a daylight saving change it is one hour more (fall) or less (spring) than the clock difference.
How DateMath is tested
DateMath's date math is tested against more than 100 cases worked out by hand. Every worked example and table on the site is computed with the same code the calculators run, so a page and its calculator can't disagree. If a result still looks wrong to you, send the link to the calculation to hello@datemath.app.
Key facts
- 14 free calculators: Date Calculator, Date Duration Calculator, Time Calculator, Hours Calculator, Time Card Calculator, Hours to Decimal Calculator, Age Calculator, Business Days Calculator, Week Number Calculator, Day Countdown, Countdown Timer, Christmas Countdown, New Year Countdown, Halloween Countdown
- Every calculation runs in your browser; the dates you enter are not sent to us
- No account, no sign-up, nothing to install
- Gregorian calendar with its leap-year rule, for every date
- Business days skip weekends and the 11 annual US federal holidays on their observed dates
- Week numbers follow ISO 8601, with the US Sunday-start number alongside
- Every calculation can be shared as a link
The tools
- Date Calculator: Add or subtract days, weeks, months or years from a date, or count the days between two dates, with weeks, months and business days. Free, no sign-up.
- Date Duration Calculator: Find the exact duration between two dates and times in years, months, days, hours and minutes, plus the total in days, hours, minutes and seconds.
- Time Calculator: Add or subtract days, hours, minutes and seconds from a date and time and see the resulting date, weekday and time. Free, works in your browser.
- Hours Calculator: Calculate the hours and minutes between two times, overnight shifts included, minus an unpaid break, in hours and minutes and in decimal hours. Free, no sign-up.
- Time Card Calculator: Free time card calculator: enter time in, time out and the lunch break for each day to total the hours worked for one or two weeks, in decimal hours and gross pay.
- Hours to Decimal Calculator: Convert hours and minutes to decimal hours for payroll, or decimal hours back to hours and minutes, with a minutes-to-decimal chart. Free, works in your browser.
- Age Calculator: Calculate exact age from a date of birth in years, months and days, plus total months, weeks and days, the weekday of birth and the next birthday.
- Business Days Calculator: Count the business days between two dates or add business days to a date, skipping weekends and, optionally, US federal holidays on their observed dates.
- Week Number Calculator: Find the ISO 8601 week number of any date, the US week number, and the Monday-to-Sunday dates of any week of the year. Free, no sign-up.
- Day Countdown: A live countdown to any date and time: the days, hours, minutes and seconds left, the weekday, calendar and business days to go, and a link to share. Free.
- Countdown Timer: A free online countdown timer: set hours, minutes and seconds or pick 30 seconds to 24 hours, then start, pause or reset it, with an alarm at zero and a full-screen view.
- Christmas Countdown: How many days until Christmas? A live countdown to December 25 in days, hours, minutes and seconds on your own clock, with the weekday Christmas falls on.
- New Year Countdown: A live countdown to midnight on January 1 in your own time zone: the days, hours, minutes and seconds to the New Year, with a full-screen view for New Year's Eve.
- Halloween Countdown: How many days until Halloween? A live countdown to October 31 in days, hours, minutes and seconds on your own clock, with the weekday Halloween falls on.
Who runs DateMath
DateMath is an independent website. Found a result that looks wrong, or missing a calculator you need? Write to hello@datemath.app.