FormatterHQ

Date & Time Calculator

Find the difference between two dates, or add and subtract seconds, days, weeks, months or years. Month-end dates and leap years are handled for you.

Loading tool…
Ready.

How to use the Date & Time Calculator

  1. Choose whether to find the difference between two dates, or to add to or subtract from a date.
  2. For a difference, pick a start and an end date and time; otherwise pick one date. The Now buttons fill in the current moment.
  3. For adding or subtracting, set the amount and the unit, from seconds to years.
  4. Read the result, including totals, weekday and Unix timestamp, and copy what you need.

Date calculator for differences and date math

This date calculator answers two everyday questions: how much time lies between two dates, and what date you reach after adding or subtracting a period. It works with plain dates or exact date-times and reports the answer in calendar units as well as totals.

Difference between two dates

Pick a start and an end date, in either order. The calculator sorts them, notes whether the end is before or after the start, and shows the gap:

Start date:     2024-01-15 00:00:00
End date:       2024-12-25 18:30:00

Difference:     11 months, 10 days, 18 hours, 30 minutes
Total weeks:    49.40
Total days:     345.77
Total hours:    8,298.5
Business days:  247

Total minutes and seconds are listed too. Business days count Monday to Friday, including the start date but not the end date; public holidays are not known to the tool, so subtract them yourself.

Adding and subtracting time

Pick add or subtract, an amount and a unit: seconds, minutes, hours, days, weeks, months or years. The result is shown in the selected time zone and in UTC, with its weekday and Unix timestamp. For example, 2024-01-15 plus 90 days is Sunday, April 14, 2024.

How month-end dates behave

Months and years are calendar units, not fixed lengths. When the target month is shorter, the day is clamped to its last day:

2024-01-31 + 1 month  = 2024-02-29   (leap year)
2023-01-31 + 1 month  = 2023-02-28
2024-03-31 − 1 month  = 2024-02-29
2024-02-29 + 1 year   = 2025-02-28

Clamping means steps do not always combine. 2024-01-31 plus 2 months is March 31, but adding 1 month twice gives March 29, because the first step lands on February 29. Month and year amounts should be whole numbers; a fractional amount such as 1.5 months is truncated to 1.

Smaller units are exact durations and may be fractional: 2.5 days adds 60 hours.

Time zones and daylight saving

Dates are picked as clock times in the time zone selected at the top, which starts on your browser's own zone; choose UTC or any other zone from the list. A difference is measured between the two clock readings, so a daylight saving change in between does not add or remove an hour: 12:00 one day to 12:00 the next is always exactly 1 day. When adding or subtracting, seconds to weeks are exact durations, so one day is always 24 hours and the clock time moves by an hour when the span crosses a daylight saving change, while months and years keep the clock time. Select UTC to avoid such shifts.

Typical uses

  • Deadlines and notice periods: 30 days from a contract date.
  • Ages and anniversaries in years, months and days.
  • Project planning with business-day counts.
  • Checking token lifetimes or cache expiry in hours or seconds.

To turn a result into epoch time or view it in another zone, use the Unix timestamp converter. For tallying hours worked, the time sheet calculator is a better fit, and the time converter changes one unit into another.

Frequently asked questions

How many days are there between two dates?
Pick both dates in difference mode. The tool shows the total days (with decimals if times are involved) and the same gap broken into years, months and days.
What is January 31 plus one month?
The calculator clamps to the last day of the shorter month, so it is February 29 in a leap year such as 2024 and February 28 otherwise. This is the same rule used by spreadsheet functions such as EDATE.
Are weekends and holidays excluded?
The business days line excludes Saturdays and Sundays. Holidays vary by country and organization, so they are not removed automatically.
Does the end date count in the difference?
The difference is measured from the start instant to the end instant, so January 1 to January 2 is one day. If you want to count both dates inclusively, add one day to the result.
How do I enter a date?
Both modes use your browser’s date and time picker, so there is no text format to get wrong: choose the day and, if it matters, the time down to the second. The values are read in the time zone selected at the top, and results are written in ISO 8601 form, such as 2024-01-15T09:30:00+01:00.

Last updated October 3, 2026

Guides

Related tools

Time Sheet Calculator Add up weekly work hours from start and end times with breaks. Calculates overtime per day or week and optional gross pay. Checksum Calculator Calculate MD5, SHA-1, SHA-256, SHA-512, CRC-32 and more checksums of a file or text at once. Chmod Calculator Convert Linux file permissions between octal (755) and symbolic (rwxr-xr-x) with checkboxes, including setuid, setgid and sticky bits. CIDR / Subnet Calculator Calculate network, broadcast, netmask, wildcard, host range and host count for any IPv4 or IPv6 CIDR block. SemVer Checker & Range Tester Validate, compare and sort semantic versions and test them against npm-style ranges like ^1.2.0, ~2.3 or >=1.0 <2. Docker Run to Docker Compose Convert one or more docker run commands into a docker-compose.yml: ports, volumes, env, restart, networks, healthchecks and more. File Type Checker Find out what a file really is from its content, not its name. Detects 150+ formats and warns when the extension does not match. HTTP Status Codes Searchable list of the HTTP status codes in use, from 100 to 511, with a plain explanation of when each response is used. JWT Decoder Decode a JSON Web Token to inspect its header, payload claims and expiry time, and verify its signature with your key. Runs locally. JWT Encoder & Generator Create and sign JSON Web Tokens with HS256, RS256, ES256, PS256 or EdDSA using a secret or PEM key. Signing happens in your browser. JWT Verifier Verify a JWT signature with a shared secret, PEM public key, X.509 certificate or JWKS and check exp, nbf, iss and aud claims. MIME Type Lookup Find the MIME / Content-Type for a file extension or the extensions for a media type — about 150 common types.