日付差計算機
2つの日付の間の正確な日数、月数、年数を計算します。
合計日数
正確な日付差計算
この計算機は各月の正確な日数とうるう年を考慮して、2つの日付の正確な期間を提供します。
Calculating Time Between Dates
Overview
Calculating the difference between two dates seems trivial — but anyone who has tried to write the code knows the edge cases pile up quickly. Leap years, varying month lengths, time zones, daylight saving transitions, calendar reforms (Russia switched calendars in 1918), and ambiguous month arithmetic (Jan 31 + 1 month = Feb 28? Mar 3?) all complicate the answer. This calculator handles all standard cases for the Gregorian calendar (1582 onward), giving you a breakdown in years, months, weeks, days, hours, minutes, and seconds.
How It Works
The tool computes the raw difference using JavaScript's Date object (millisecond precision), then breaks it into hierarchical units. Years are counted as completed years (Feb 1 → Jan 31 next year = 0 years, not 1). Months use day-of-month preservation when possible. The calculator also offers business-days-only mode for project planning (excludes weekends; doesn't account for holidays unless you provide them).
When to Use This
Calculate days until a deadline, weeks until a vacation, months between life events (anniversaries, work milestones), or precise age between birth and a target date. Project managers use it for estimating timelines. Anyone tracking habits (X days streak) needs precise day counts across timezone-crossing trips. Legal contracts often specify dates 30/60/90 days from signing.
Frequently Asked Questions
Why does the result sometimes differ by one day?
Time zones. If you enter '2024-01-01' it's interpreted in your local timezone, but the system might compute against UTC. For business use, prefer UTC-explicit inputs or use the same timezone for both dates.
How are leap years handled?
Years divisible by 4 are leap (366 days) except century years not divisible by 400. 1900 was not a leap year, but 2000 was. The calculator handles this automatically.
Does it count both start and end day?
By default no — Jan 1 to Jan 2 = 1 day. Many calendars count inclusively (Jan 1 to Jan 2 = 2 days). Be aware which convention matters for your use case.
おすすめのツール
役に立つかもしれない厳選されたツール