Calculate the time between two dates and times, each in its own time zone. See the difference in years, months, days, hours, minutes, seconds and milliseconds. Set a max unit to get totals instead, such as the number of days or hours between two dates.
It subtracts one date and time from another and breaks the result into calendar units. Each date has its own time zone and display format, so you can compare, for example, a departure time in Tokyo with an arrival time in New York. The result is always Date1 - Date2.
YYYY-MM-DD HH:mm:ss)Years, months and days are counted on the calendar: the calculator adds whole months to Date2 as long as it does not pass Date1, then whole days, and then measures the remaining hours, minutes, seconds and milliseconds as real elapsed time. Units larger than Max unit are not used and are greyed out.
| Date1 | Date2 | Max unit | Result |
|---|---|---|---|
| 2023-01-15 14:30 | 2023-01-01 10:00 | Year | 14 days 4 hours 30 minutes |
| 2023-01-15 14:30 | 2023-01-01 10:00 | Hour | 340 hours 30 minutes |
| 2024-03-01 12:00 | 2024-02-28 12:00 | Year | 2 days (2024 is a leap year) |
| 2023-02-28 00:00 | 2023-01-31 00:00 | Year | 1 month |
| 2024-01-10 10:00 Asia/Tokyo | 2024-01-10 10:00 America/New_York | Year | -14 hours |
The result is Date1 minus Date2. If Date1 is earlier, every value is zero or negative. Swap the dates if you want a positive result.
Set Max unit to Day. The Days field then shows the full count of days, and the smaller fields show the remaining hours, minutes and seconds.
Adding one month to January 31 lands on the last day of February, because February has no 31st. The calculator follows this calendar rule, so the difference is exactly 1 month.
The date and time you entered stay the same, but they are now read as local time in the new zone, so they point to a different moment and the difference changes. This is how you compare local times in different places.