日付の差・期間計算

2つの日付の間の年・月・週・日数を詳細に計算します。

Difference between two dates

仕組みと計算ルール

  1. Both dates are parsed strictly (real calendar dates only; Feb 30 is rejected) and compared on the calendar, never by dividing milliseconds, so daylight saving cannot skew a count.
  2. The years/months/days breakdown steps forward from the earlier date using the same clamping rules as the add-months engine: Jan 31 + 1 month counts as Feb 28/29, so the parts always compose to the real elapsed time.
  3. Total days are reported elapsed (start exclusive) by default, with a toggle to include the end date for use cases like hotel stays.

知っておくと便利なポイント

  • Enter the dates in either order: the tool reports which date is earlier and normalizes the direction.
  • The weekday breakdown counts both endpoints and is only offered for spans up to about 1,000 years.
  • Month lengths and leap years (including 1900 and 2100 being non-leap) are handled by the shared, unit-tested calendar engine.

よくある質問

Why can the months part seem surprising?
Calendar months have different lengths, so “1 month” from Jan 31 lands on Feb 28/29, and day counts borrow from the previous month. The tool uses the standard calendar convention and states it.
Is the end date included?
The calendar breakdown counts elapsed time (start exclusive). The total-days figure has a toggle to include the end date when needed, such as for hotel stays.
Does it handle leap years and month ends?
Yes: February 29, non-leap centuries like 1900 and 2100, year boundaries, and month-end clamping are all handled by the core calendar engine.