One representation for every date
Every date, Hijri or Gregorian, is converted to a single day number (days since 1 January 1970). All arithmetic happens on that number, never on clock time, so daylight saving and time zones cannot introduce off-by-one-day errors.
Gregorian calendar
- We use the proleptic Gregorian calendar: today’s rules applied to all dates, including before 1582.
- Leap years are divisible by 4, except centuries not divisible by 400 (2000 was a leap year; 1900 was not).
- Supported years: 1 to 9999.
Hijri calendar (Umm al-Qura)
- We use Umm al-Qura as shipped in the ICU library used by modern browsers. We do not maintain our own tables.
- Exact range: 1 Muharram 1300 AH (12 November 1882) to the end of 1600 AH (25 November 2174).
- Outside that range the arithmetic (tabular) Hijri calendar is used and results are labelled approximate.
- Hijri → Gregorian: we locate the first day of the requested Hijri month and add the day offset. Dates that do not exist (e.g. day 30 of a 29-day month) are rejected.
- Moon sighting: the official start of Ramadan, Shawwal and Dhu al-Hijjah can differ from the calendar by a day.
- If a browser lacks Umm al-Qura support, the tools fall back to the arithmetic calendar and label every Hijri date approximate.
Exact age
For a birth date and a target date:
- Find the largest number of whole months whose monthly anniversary does not pass the target date.
- Each anniversary is computed from the original birth date, never chained, so errors cannot accumulate.
- If the birth day does not exist in a month, the month’s last day is used.
- Years = months ÷ 12, months = the remainder, days = target date − last anniversary.
The same rule applies on the Hijri calendar with Umm al-Qura month lengths.
| Case | Result |
|---|---|
| Birth date equals target date | 0 years, 0 months, 0 days |
| Born 29 Feb, on 28 Feb of a common year | Completes a full year |
| Born 31 Jan 2001, on 1 Mar 2001 | 1 month and 1 day |
| Born on the 30th of a Hijri month that later has 29 days | Year completes on the 29th |
| Birth date after target date | Error message |
Some legal systems use 1 March instead of 28 February for 29 February birthdays; we use 28 February everywhere for consistency.
Other units
- Days: difference between the two day numbers. Weeks: days ÷ 7 with the remainder in days. Months: whole months from step 1.
- Hours, minutes, seconds: elapsed time from the birth instant (midnight, or your time of birth) to now, or to the start of the target date.
- Decimal years: days ÷ mean year length (365.2425 Gregorian; 354.367 Hijri).
“Today” and time zones
“Today” is determined in Riyadh time (UTC+3, no daylight saving) by default, switchable to your device’s time zone. For elapsed hours on historical dates we use the fixed +3 offset; the difference from historical local mean time is minutes, never a date.
Next birthday
The nearest anniversary on or after today, with the same last-day-of-month rule. Progress = days since the last birthday ÷ days in the current year of life. Computed separately on both calendars.
Date difference and working days
- In the Date Difference tool the end date is excluded by default; an explicit option includes it (+1 day). The Working Days Calculator includes it by default, because office days are usually counted inclusively.
- Working days exclude the selected weekend: Friday and Saturday by default (Saudi Arabia since 29 June 2013), with a Thursday–Friday option for earlier periods.
- Public holidays are not subtracted.
Testing
The calculation engine is separate from the interface and covered by automated tests: leap years, month and year boundaries, 29 February births, future and historical dates, a Hijri round trip for every day from 1300 to 1600 AH, and thousands of randomised cases checking that birth date + age = target date.
This page is part of our commitment to transparency; see also About and the Terms of Use.
Last updated: