Methodology
How Whatistheday calculates weekdays, converts between calendar systems, determines holiday dates, and detects your region.
Weekday Calculations
All weekday calculations use Julian Day Numbers (JDN), a continuous count of days since the beginning of the Julian period (January 1, 4713 BCE). This method is used by astronomers worldwide and provides exact weekday results for any date in the Gregorian or Julian calendar.
The formula converts a Gregorian date to its JDN, then takes the result modulo 7 to determine the day of the week. This approach eliminates the complexities of varying month lengths, leap years, and calendar reforms.
For dates before October 15, 1582 (when the Gregorian calendar was adopted), we use the Proleptic Julian calendar with appropriate adjustments for the Julian-to-Gregorian transition.
Calendar Conversion Algorithms
Hebrew (Jewish) Calendar
The Hebrew calendar conversion uses the full lunisolar algorithm accounting for the 19-year Metonic cycle (where 235 lunar months ≈ 19 solar years). It implements all four Dehiyot (postponement rules): Molad Zaken, Lo ADU, GaTRaD, and BeTU-TaKPaT.
Leap years in the Hebrew calendar add an extra month (Adar I), occurring in years 3, 6, 8, 11, 14, 17, and 19 of each 19-year cycle. The variable lengths of Cheshvan (29-30 days) and Kislev (29-30 days) are correctly computed based on the year type (deficient, regular, or complete).
Hebrew numerals (gematria) are displayed using standard conventions, including the special forms for 15 (טו) and 16 (טז) to avoid spelling divine names.
Islamic (Hijri) Calendar
The Islamic calendar conversion uses the Kuwaiti (tabular) algorithm, an arithmetic approximation of the lunar Hijri calendar. This algorithm uses a 30-year cycle containing 11 leap years (years 2, 5, 7, 10, 13, 16, 18, 21, 24, 26, and 29).
Important note: The actual Islamic calendar in most countries is based on physical moon sighting, which can differ from the tabular algorithm by 1-2 days. For religious observance, always consult your local Islamic authority.
Chinese Lunar Calendar
The Chinese calendar display includes the zodiac animal year (based on the 12-year cycle), Heavenly Stems, and Earthly Branches. The era year uses the traditional Yellow Emperor epoch (2697 BCE).
Other Calendar Systems
The Julian calendar conversion accounts for the 13-day offset from the Gregorian calendar (for dates after 1900). The Maya Long Count uses the GMT correlation constant (584,283). The Hindu Vikram Samvat calendar adds 56-57 years to the Gregorian year.
Holiday Date Calculations
Holidays fall into two categories:
- Fixed-date holidays (Christmas, New Year's) use their standard Gregorian dates.
- Variable-date holidays use specific algorithms for each tradition.
Easter is calculated using the Anonymous Gregorian algorithm (also known as the Meeus/Jones/Butcher algorithm), which determines the first Sunday after the first full moon on or after March 21.
Passover uses the Gauss algorithm for computing 15 Nisan, with corrections for the GaTRaD and BeTU-TaKPaT postponement rules.
Ramadan and Eid al-Fitr dates use pre-computed tables for 2020-2030. The Islamic lunar calendar shifts approximately 10-12 days earlier each Gregorian year. Actual dates depend on local moon sightings.
Diwali, Chinese New Year, and Hanukkah use pre-computed tables for the 2020-2030 range, verified against official sources.
Region Detection
Whatistheday detects your approximate location using the ipapi.co geolocation API, which determines your country based on your IP address. This is used solely to display a relevant region label — no personal data is stored or tracked.
The geolocation result is cached in your browser's localStorage for 24 hours to minimize API calls. If the API is unavailable (timeout after 3 seconds), we fall back to timezone-based detection using your browser's Intl.DateTimeFormat API.
You can always manually override the detected region using the "(change)" button next to the region indicator.
Business Day & Date Difference Calculations
Business days are calculated by iterating through the date range and excluding Saturdays and Sundays. The date difference calculator uses standard calendar arithmetic, correctly handling month boundary crossings and leap years.
ISO week numbers follow the ISO 8601 standard: weeks start on Monday, and Week 1 is the week containing the year's first Thursday.
Data Sources & Accuracy
All calculations are performed client-side in your browser using JavaScript. No dates are sent to any server. The algorithms are based on well-documented astronomical and mathematical formulas:
- Meeus, Jean. Astronomical Algorithms (1991) — JDN and calendar conversions
- Reingold & Dershowitz. Calendrical Calculations (2018) — Hebrew, Islamic, and other calendars
- ISO 8601 — Week numbering standard
- Various national government sources — public holiday dates
While we strive for accuracy, calendar systems that depend on astronomical observation (like the Islamic calendar) or local authority decisions may vary. For religious, legal, or financial purposes, always verify with an authoritative local source.
Frequently Asked Questions
How accurate are the calendar conversions?
Our Gregorian, Julian, and Hebrew calendar conversions use well-established astronomical algorithms and are accurate for any date. The Islamic calendar uses a tabular approximation that may differ by 1-2 days from local moon sightings.
What algorithm is used for weekday calculation?
Weekday calculations use Julian Day Number (JDN) conversions, which are astronomically precise for any date in the Gregorian or Julian calendar.
How are holiday dates determined?
Fixed-date holidays use standard Gregorian dates. Variable holidays use established algorithms (Anonymous Gregorian for Easter, Gauss for Passover) or verified pre-computed tables.