Count dates consistently
The day difference excludes the starting date. The inclusive result counts both endpoints. Reversing the dates produces a signed result, so you can distinguish a past date from a future one.
Use calendar intervals
Adding one calendar month is different from adding 30 days. Leap years and month lengths are handled by Temporal calendar arithmetic. Invalid dates such as February 30 are rejected instead of silently rolling into March.
Frequently asked questions
Are these elapsed 24-hour periods?
No. These are calendar-date operations without a time zone or time of day. A local calendar day across daylight saving can last 23 or 25 hours. Use explicit instants when measuring elapsed time.
What happens when adding a month to January 31?
The default reports an invalid date if the destination month has no day 31. Select the last-day option to constrain the result to February’s last day. Years and months are adjusted before days.