Practical guide
Date differences, hours and age — how can off-by-one errors be avoided?
Date calculations depend on whether you need elapsed time, a count of calendar days or inclusive dates. Always name the chosen convention before using the result.
Elapsed time excludes the starting instant
One day passes from 1 January to 2 January. If a task counts both attendance or event dates, one may need to be added to the ordinary difference.
The date-difference tool has a separate Monday–Friday mode excluding Polish holidays for 2024–2026. Both boundaries can be included; weekend holidays are not deducted twice. This is not statutory working time or a legal deadline.
A clock interval can cross midnight
When the end clock is earlier than the start, the interval may end on the next day. An explicit choice prevents a negative result.
You can add independent intervals with breaks or convert decimal hours: 7.5 hours means 7 hr 30 min. Overlaps are not merged. Time zones and daylight-saving changes require full dates and are not modelled here.
Age uses complete calendar periods
Complete years increase on a birthday. Months vary in length, so dividing days by 365 or 30 does not produce exact calendar age.
The default date is today in Europe/Warsaw. We use 28 February for leap-day anniversaries in non-leap years and clamp missing days to month end. This is an explicit calendar convention, not a determination of legal age.
Frequently asked questions
What does this guide explain about “Elapsed time excludes the starting instant”?
One day passes from 1 January to 2 January. If a task counts both attendance or event dates, one may need to be added to the ordinary difference. The date-difference tool has a separate Monday–Friday mode excluding Polish holidays for 2024–2026. Both boundaries can be included; weekend holidays are not deducted twice. This is not statutory working time or a legal deadline.
What does this guide explain about “A clock interval can cross midnight”?
When the end clock is earlier than the start, the interval may end on the next day. An explicit choice prevents a negative result. You can add independent intervals with breaks or convert decimal hours: 7.5 hours means 7 hr 30 min. Overlaps are not merged. Time zones and daylight-saving changes require full dates and are not modelled here.
What does this guide explain about “Age uses complete calendar periods”?
Complete years increase on a birthday. Months vary in length, so dividing days by 365 or 30 does not produce exact calendar age. The default date is today in Europe/Warsaw. We use 28 February for leap-day anniversaries in non-leap years and clamp missing days to month end. This is an explicit calendar convention, not a determination of legal age.
Calculators covered by this guide
Date difference and Polish working days
Compare dates or count weekdays excluding Polish public holidays.
Hours and time calculator
Add time intervals and convert decimal hours.
Age calculator
Calculate complete age in years, months and days on a selected date.