Datetime Calculator - Compute Differences and Add/Subtract Time
Two modes: "Difference" computes the gap between two datetimes in years, months, days, hours, minutes, and seconds; "Add/Subtract" adds or subtracts time units from a base datetime. No external libraries.
How to Use
- In the Difference tab, enter start and end datetimes to automatically compute the gap
- Results show a breakdown in years, months, days, hours, minutes, and seconds, plus totals
- In the Add/Subtract tab, set a base datetime, operation, value, and unit
- The result is computed automatically as you configure the options
Usage Examples
Days until a deadline: Set today as start and the deadline as end to instantly see the remaining days.
Date 30 days from now: Add 30 days to today's datetime to find the target date.
Employment duration: Calculate years and months of employment from the hire date to today.
FAQ
- How is "month" calculated?
- 365.25 days = 1 year and 30.44 days = 1 month are used as approximations. Minor inaccuracies may occur.
- Can I specify seconds?
- Yes. The datetime-local field accepts seconds.
- Can I calculate past dates?
- Yes. If the end datetime is before the start, the result is shown with a minus sign.
- Is data sent to a server?
- No. Everything runs in the browser.
- Is timezone taken into account?
- The browser's local timezone is used.
Related Tools
Update History
Last Updated: 2026-02-20
- 2026-02-20 Initial release