🧰 UtlKit

How to Use the Date Calculator: Add or Subtract Days, Weeks, Months or Years, and the Exact Day Count Between Two Dates in the Browser

Two modes: add or subtract days, weeks, months or years to a start date, or diff two dates into an exact day count with weeks, months and years derived from it, all computed in the browser.

The Date Calculator has two modes. In Add / Subtract mode it takes one start date, an action, an amount and a unit, and prints one line: the start date, the sign, the amount, the unit, and the landing date with its weekday and month spelled out. In Date Difference mode it takes two dates and prints the exact day count between them with the weeks, months and years derived from that count. Every figure is computed in the browser from the Date object itself, with no backend and no API call. Start at the Date Calculator and keep the defaults: type 2026-09-24 as the start date, keep Add selected with Days, enter 30.

The add mode result line

The result line reads start date, sign, amount and unit, equals landing date, with the start date printed as the raw ISO value and the landing date spelled out in full: weekday, month name and day, in the language of the page. The running example prints 2026-09-24 + 30 Days = Saturday, October 24, 2026. The same run on the German page prints Samstag, 24. Oktober 2026, on the Chinese page 2026年10月24日星期六, and on the Japanese page 2026年10月24日土曜日, because the landing date is formatted through the browser locale data rather than a fixed template. The action select flips the sign, and 2026-09-24 minus 14 days reads Thursday, September 10, 2026. The copy button next to the result puts the whole line on the clipboard.

The four units

The unit select offers days, weeks, months and years, and the two pairs behave differently. Days and weeks are day arithmetic: a week is converted to days first, so 5 weeks enters as 35 days, and 2026-09-24 plus 5 weeks lands on Thursday, October 29, 2026. Months and years are calendar arithmetic: the month or year field is moved and the day of month is kept, so 2026-09-24 plus 3 months lands on Thursday, December 24, 2026. The amount is clamped before the arithmetic, at 3650 days, 520 weeks, 120 months and 10 years, the same ten year horizon expressed four ways, and a value past the clamp is trimmed to the cap, so 3651 days enters as 3650, instead of raising an error.

Month and year overflow

Calendar arithmetic keeps the day of month, and when the target month does not have that day the surplus days spill into the following month. January 31, 2026 plus 1 month has no 31st in February 2026, which has 28 days, so the three surplus days land the result on Tuesday, March 3, 2026, not on February 28. The identical start in 2024 lands on March 2, because that February has 29 days. Year addition applies the same rule to the year field: February 29, 2024 plus 1 year has no 29th in February 2025, so it lands on March 1, 2025. The overflow works in the subtract direction as well: March 31, 2026 minus 1 month lands on March 3, 2026, while January 31, 2026 minus 1 month lands cleanly on Wednesday, December 31, 2025, because December has 31 days. The result line always prints the computed date, so the overflow is visible instead of silent. The future date guide applies this same rule to due date and target date questions.

The difference mode

Difference mode takes two dates and computes the absolute millisecond gap between them, so the order of the two inputs does not matter. The day count is that gap divided by 86400000 milliseconds and rounded, and it is the only exact figure on the line. Weeks, months and years are derived from the day count with fixed divisors, 7, 30.44 and 365.25, each floored. The run from 2024-01-01 to 2026-07-01 prints 912 days = 130 weeks ≈ 29 months ≈ 2 years. The approximations matter: counted on the calendar, January 1, 2024 to July 1, 2026 spans exactly 30 months, but 912 divided by 30.44 is 29.96, which floors to 29, so the month figure is a conversion of the day count, not a count of months. A short span, 2026-09-24 to 2026-12-25, prints 92 days = 13 weeks ≈ 3 months ≈ 0 years.

How the dates are parsed

The date inputs return a plain YYYY-MM-DD string, and the tool builds a Date from the year, month and day components at local midnight instead of parsing the string, because a date-only string parses as UTC midnight, which reads a day early in every timezone west of UTC. Building the date from components keeps 2026-09-24 as 2026-09-24 in the user's own timezone, so the day count between two dates does not depend on where the user sits.

What it is not

The Date Calculator is not an age calculator: for the one case where the end date is pinned to today and the answer is years, months and days of age, the Age Calculator runs that breakdown. It is not a unix timestamp converter either: for the same span in epoch seconds, the Unix Timestamp Converter rewrites the dates as integers and the day count comes out of the difference divided by 86400. And it does not count business days: both modes count calendar days, weekends and holidays included. For the business day side of a date gap, the date difference guide walks the Monday through Friday convention and its off-by-one edge cases.

Related Tools

Frequently Asked Questions

Does the Date Calculator call any API or server?

No. It parses each date input into a local-midnight Date, does the day, month or year arithmetic with browser Date methods, and formats the landing date through the browser Intl data for the page language. Difference mode is one millisecond subtraction and four divisions. Nothing you type leaves the page.

Why does January 31 plus 1 month land on March 3 instead of February 28?

Month addition keeps the day of month, and when the target month does not have that day the surplus days spill into the following month, instead of clamping to the month end. February 2026 has 28 days, so January 31 plus 1 month is three days past the end of February, which is March 3. The identical start in 2024 lands on March 2 because that February has 29 days, and February 29 plus 1 year lands on March 1 in a non-leap year. The result line prints the computed date, so the overflow is visible.

Why do months and years in difference mode look approximate while days are exact?

Because they are derived differently. The day count is the millisecond gap divided by 86400000 and rounded, so it is exact. Weeks, months and years divide the day count by the fixed numbers 7, 30.44 and 365.25 and floor the result, so they are conversions of the day count, not calendar counts. That is why 912 days prints 130 weeks, about 29 months and about 2 years, even though the calendar span from January 1, 2024 to July 1, 2026 is exactly 30 months.

In which timezone are the date inputs read?

Yours. The tool builds each date from its year, month and day components at local midnight instead of parsing the ISO string, because a date-only string parses as UTC midnight and reads a day early west of UTC. The day count between two dates is identical in every timezone, and the landing date is spelled out in the page language.

Do weekends and holidays count in the day difference?

Yes. Both modes count calendar days, so a Monday-to-Monday span is 7 days, weekend or no weekend in between. Counting only working days, or excluding public holidays, is a different convention with its own off-by-one edge cases, and the date difference guide covers that version of the question.

Related Articles