Time Addition & Subtraction Calculator

Add or subtract years, days or hours from a date, or find the gap between two moments. Useful for deadlines, trial periods and expiry dates.

Time Addition & Subtraction Calculator

Time & Automation

Runs locally in your browser.

Runs locally in your browser — add or subtract years, months, days, hours, minutes and seconds from any date.

About the Time Addition & Subtraction Calculator

When developing software, performing QA testing, or working with databases, being able to calculate an exact timestamp in the future or past is a common task. It can be critical to know precisely when a JSON web token expires after being issued with a 90-day, 12-hour, and 30-minute lifetime. It can also be necessary to analyze server logs and identify an event that occurred 72 hours ago. Date arithmetic sounds simple but is easy to get wrong by hand because of leap years and rollovers. The Time Addition & Subtraction Calculator is a utility that helps you perform date math with greater precision and fewer headaches. This tool is built to respect your privacy and protect sensitive information by doing all calculations locally in your browser.

Key Features of Time Addition & Subtraction Calculator

  • Granular Time ControlsPerform precise date math by entering the exact number of years, months, days, hours, minutes, and seconds that you want to add or subtract.
  • Bidirectional OperationsYou can both calculate the timestamp of a future date and perform reverse date math to determine a past timestamp.
  • Complex Rollover HandlingYou get full control over the date math operation and can let the utility handle all of the complexities of leap years, months with different numbers of days, and hour/minute rollover.
  • 100% Local ExecutionYour operational data is sacred. Calculations are performed locally in your browser.

How to Use Time Addition & Subtraction Calculator

  1. Use the dropdown box under the "Mode" header to choose between the "Add / subtract time from a date" and "Calculate time difference between two dates" modes.
  2. Enter the chronological reference point in the "Base date & time" box using the YYYY-MM-DD HH:MM:SS format.
  3. Fill in the boxes below the "Add / subtract" header with the values for years, months, days, hours, minutes, and seconds.
  4. Click the purple "Calculate" button to perform complex date math and get the result.
  5. You can click the "Copy" button to copy the result to your clipboard or the "Clear" button to start a new calculation.

Time Addition & Subtraction Calculator Examples

Adds 45 days and 6 hours to a date at the end of January (run in UTC).

Input
Base: 2026-01-31 10:00
Add: 45 days, 6 hours
Result
Base date:   2026-01-31 10:00:00
Delta:       0y 0mo 45d 6h 0m 0s
Result:      2026-03-17 16:00:00

Total shift: 3909600 seconds (45.25 days)
ISO 8601:    2026-03-17T16:00:00.000Z
Unix:        1773763200

Time Addition & Subtraction Calculator — Frequently Asked Questions

Why is manual date math so challenging for programmers?
Manual time addition is a pain because the calendar is not a decimal-based system. To add 45 days to a date, you have to worry about how many days are in the month and whether or not it is a leap year. You then have to carry over the extra days to the next month and so on for hours and minutes.
Can I subtract time using the time calculator?
You can use the date/time utility to perform both addition and subtraction operations. The tool has a special mode for bidirectional date math, which lets you enter the time values that you want to add or subtract to a base timestamp.
Is it safe to paste my server log timestamps here?
You can be rest assured that all timestamp calculations are done locally in your browser. The utility does not transmit any of your data to its servers, where it could be at risk of being compromised.