Methodology

How the calculator works.

Every mode uses one shared date module. This page lists the rules it follows, so you can predict any result and reproduce it elsewhere.

Last updated: October 2026 ยท Age in Days

Dates, not timestamps

  • Inputs are calendar dates in YYYY-MM-DD form, from year 1 to 9999.
  • A date that does not exist, such as February 29, 2026 or April 31, is rejected. It is never moved to a nearby valid date.
  • Dates are compared as day numbers built from year, month, and day. Time of day, time zones, and daylight saving never affect a count.
  • The Gregorian calendar applies to every year, including years before it was adopted. Historical Julian dates need converting first.
  • "Today" is the date on your device. Countdown and next-birthday results refresh after local midnight.

Counting rules

ModeMain figureEndpoint rule
Age on a dateDays from birth date to the reference dateBirth date is day 0
Days betweenDays from start to endStart excluded. The inclusive count is shown alongside.
CountdownDays from today to the target1 the day before, 0 on the day, then days since
Working daysMonday to Friday dates, minus selected holidaysBoth dates included
Next birthdayDays from today to the next birthdayThe birth date itself is not a birthday
Day milestoneBirth date plus the chosen number of daysBirth date is day 0

If the end date is before the start date, the span is reported as a positive number and the result notes the order.

Years, months, and days

The breakdown counts the largest number of whole months whose anniversary is not after the end date, then the remaining days. When the start day does not exist in a later month, that month's anniversary is its last day. So January 31 plus one month is February 28, or February 29 in a leap year.

Weeks are total days divided by 7, with the remainder shown. Hours and minutes are total days times 24 and times 1,440, labeled as approximate because no birth time is entered.

February 29 birthdays

In a common year, a February 29 birthday is placed on February 28. When the March 1 convention would give a different age or next birthday, the result adds a row labeled "If your rule uses March 1." The day total does not depend on the convention.

Working days and holidays

Working days are Monday to Friday dates in the range, both ends included, minus any holiday from the selected list that falls on one of those dates. Holidays are computed from their rules for 1978 to 2099. Years outside that range are counted without holiday adjustments, and the result says so.

  • US federal holidays: the 11 holidays in 5 U.S.C. 6103, each from the year it began (Martin Luther King, Jr. Day from 1986, Juneteenth from 2021). Saturday holidays move to Friday and Sunday holidays to Monday. Inauguration Day and one-off executive closures are not included.
  • UK bank holidays: England and Wales only. Easter is computed with the Gregorian Easter algorithm. New Year's Day, Christmas Day, and Boxing Day move to the next free weekday when they fall on a weekend. One-off and moved holidays since 1978 are listed by year in the code and on the UK page.

Holiday dates are checked against the GOV.UK bank holiday feed for 2019 to 2028 and against the open-source holidays library for every year from 1978 to 2099. A one-off holiday announced in the future appears only after the code is updated.

Shared links

Copy link puts the mode and inputs after the # in the address, for example #mode=age&from=1990-06-15&to=2026-10-14. When a shared link opens, the calculator reads those values, checks that each date exists, and then removes them from the address bar. Results that depend on today, such as countdowns, are calculated from the viewer's own date.

Reference tables

Tables on the holiday, working days, leap year, and milestone pages are written by a script that calls the same date module as the calculator. An automated check fails if a published table differs from what the code produces.

Testing

Automated tests cover invalid dates, the century leap year rule, month and year ends, daylight saving spans, reversed ranges, inclusive counts, birthdays and February 29, day milestones, holiday dates and substitute days, and working-day totals. Browser tests exercise the calculator at phone and desktop widths. When a rule changes, the change and its date are recorded in site updates.