Calendar Systems That Aren't Gregorian: Lunar, Islamic, Hebrew, and Buddhist Calendars Explained
Islamic, Hebrew, Buddhist, and lunar calendars decoded. Intercalation rules, epoch dates, conversion math, and why developers need to know them.
The Gregorian calendar is the de facto global standard for civil timekeeping, but it is not universal: Islamic, Hebrew, Buddhist, and lunar calendars remain legally authoritative in dozens of countries and regions, creating real conversion headaches for developers building international software. This article covers intercalation rules, epoch dates, and conversion algorithms for the non-Gregorian systems that matter most in production.
Introduction
When you're asked to build a calendar widget that works in Saudi Arabia, Israel, Thailand, or mainland China, you've just inherited someone else's math problem. The Gregorian calendar is mathematically elegant—a 400-year cycle, straightforward leap-year rules—but it's also a relatively recent import to most of the world. The Islamic calendar, adopted across the Muslim-majority Middle East and North Africa, uses a 12-month lunar cycle with no intercalation, so it drifts ~11 days per year against the solar year. The Hebrew calendar, still used for religious observances and official holidays in Israel, intercalates an entire extra month seven times in a 19-year cycle. Thailand's Buddhist calendar adds 543 years to the Gregorian year. China's lunar calendar packs a leap month into specific years to stay synchronized with the solar cycle.
Understanding these systems at the implementation level—not just "they exist," but how epoch dates are defined, where years actually start, and which intercalation rules fire—is essential if you're building date-sensitive features for global users. You'll encounter these calendars in HR software (scheduling Ramadan-aware scheduling), event systems (Jewish holidays), international payroll (Thai fiscal years), and any app that touches multiple cultures. This article breaks down the mechanics of the four most-implemented non-Gregorian systems, shows you the conversion math, and highlights the real gotchas you'll face in production.
Why the Gregorian Calendar Isn't Universal (and Why That Matters for Tech)
The Gregorian calendar is solar: each year follows Earth's ~365.2425-day orbit around the sun. It was introduced by Pope Gregory XIII in 1582 and adopted gradually across Europe and its colonial territories over the next three centuries. But adoption was not total. Much of the Orthodox Christian world kept the Julian calendar (which has a slightly different leap-year rule and is now 13 days behind Gregorian) until well into the 20th century. More crucially, Islamic, Hindu, Jewish, Buddhist, and traditional East Asian cultures never abandoned their own calendars for civil purposes, even when Gregorian dates became widely known.
Today, the Islamic calendar is legally recognized for religious and public holidays across Saudi Arabia, the UAE, Egypt, and much of the Arab world. Israel uses the Hebrew calendar for official holidays and year numbering. Thailand officially numbers years by the Buddhist Era. China uses a lunisolar calendar for the Spring Festival (Chinese New Year). Multiple calendars can coexist: Saudi Arabia, for instance, prints both Islamic and Gregorian dates on official documents. From a developer's perspective, this means you cannot assume a user's local date representation is Gregorian.
The practical cost is higher than it sounds. If your event system stores only a Gregorian date and a user in Cairo wants to schedule something for "the 15th of Ramadan," you must convert: Ramadan is the ninth month of the Islamic calendar, and its Gregorian equivalent shifts every year because the Islamic calendar is purely lunar. If you get the conversion wrong by even one day, you might invite someone to the wrong date. If you're building HR software for a multinational with employees in Israel, you need to understand that "year 5786" (the current Hebrew year as of early 2026) does not correspond to 2026 in a simple linear way.
These aren't edge cases. According to 2026 data from the UN Department of Economic and Social Affairs, over 1.8 billion people live in regions where a non-Gregorian calendar is legally or religiously significant. The cost of mishandling dates in those regions is not just embarrassment—it's compliance risk, lost revenue, and eroded trust.
The Islamic Calendar: Lunar Months, Year Numbering, and Drift
The Islamic calendar (also called the Hijri calendar) is the simplest of the non-Gregorian systems to understand mechanically, yet it creates the most obvious problems in practice. It consists of exactly 12 months, always alternating between 30 and 29 days, for a total of 354 or 355 days per year (depending on whether the 12th month, Dhu al-Hijjah, is given 29 or 30 days). There is no intercalation: no leap months, no leap years that add an extra day to a month. The calendar is purely lunar.
This means the Islamic year is ~11 days shorter than the Gregorian solar year. Over time, Islamic months drift relative to the seasons. Ramadan (the 9th month) was originally timed to an actual season, but today it rotates through all seasons over a ~33-year cycle. In 2026, Ramadan spans late February to late March (in early 2026, it was roughly February 27 to March 28). In 2035, it will fall in winter. In 2050, summer.
Islamic year numbering starts from the Hijra, the Prophet Muhammad's emigration from Mecca to Medina. This event is traditionally dated to July 16, 622 CE in the proleptic Gregorian calendar. However, the Islamic calendar counts this as the first day of Muharram, year 1 AH (Anno Hegirae). The relationship is not linear: Islamic year 1448 AH corresponds roughly to 2026-2027 CE, but the exact mapping depends on when in each Gregorian year you're measuring.
Intercalation rules for the Islamic calendar are actually quite strict, despite the absence of leap months. The question of which years add an extra day to Dhu al-Hijjah was historically debated, but the modern tabular (arithmetic) Islamic calendar uses the Kuwaiti algorithm: in a 30-year cycle, years 2, 5, 7, 10, 13, 16, 18, 21, 24, 26, and 29 have 30 days in the 12th month; all others have 29. This 30-year cycle repeats infinitely. The result is that the average Islamic year length is 354.367 days, which drifts against the solar year but does so predictably.
To convert from Gregorian to Islamic, you cannot simply subtract 622 and divide—you must account for the different year lengths. A rough formula: if you have a Gregorian date (Y, M, D), the Islamic year is approximately (Y - 622) × 1.0307 + (M / 12), but you must then verify by checking which months have passed in the Islamic calendar. Libraries like moment-hijri (JavaScript) and the ICU library handle this by maintaining lookup tables or algorithmic rules based on the tabular calendar.
Real scenario: you're building a scheduling system for a Saudi telecom company. An employee requests time off for "the 15th of Shawwal, year 1448 AH." You receive that date as input. To store it in your database (which likely uses Unix timestamps or ISO 8601 Gregorian dates), you must convert: Shawwal (month 6) in year 1448 AH corresponds to roughly May 2026 CE. But the exact day depends on the precise Hijri calendar calculation rule in use. The Saudi government recognizes the tabular calendar for civil purposes, but some systems in other countries use astronomical observation (actual sighting of the crescent moon) to determine month starts. This can shift holidays by a day or two across regions.
The Hebrew Calendar: Intercalation, Year Names, and 'Year 5786'
The Hebrew calendar is lunisolar: it counts lunar months (29 or 30 days) but intercalates an extra month periodically to keep the calendar synchronized with the solar year and the seasons. The year 2026 CE corresponds to year 5786 in the Hebrew calendar (the number comes from adding up all the generations listed in the Hebrew Bible, though this is a traditional rather than scientifically verified count).
Hebrew year numbering began with creation (or, in traditional reckoning, with the epoch year 3761 BCE). Thus, Hebrew year 5786 corresponds to 5786 - 3761 = 2025 CE, and so on. The offset is not exactly 3761 for all dates, because Hebrew years can begin at different times relative to Gregorian years—this is the root cause of much confusion.
Intercalation in the Hebrew calendar works like this: a 19-year cycle (called the Metonic cycle) contains exactly seven leap years. In years 3, 6, 8, 11, 14, 17, and 19 of each 19-year cycle, an extra month (Adar I) is inserted before the regular month of Adar. This brings the average year length to about 365.24 days, closely matching the solar year. The cycle has restarted many times; as of 2026, we are in cycle 305 of this system (with some variation depending on epoch-reckoning conventions).
A Hebrew date like "15 Nisan 5786" specifies the day of the month, the month name, and the year. Nisan is traditionally the first month of the religious year (though Tishrei, in autumn, marks the civil year). The challenge: determining which Gregorian dates fall within a given Hebrew month requires knowing (1) whether the year is a leap year (Adar I intercalation), (2) whether Heshvan (month 8) has 29 or 30 days in that year, and (3) whether Kislev (month 9) has 29 or 30 days. These are not fixed; they depend on detailed calculations involving the time of the new moon and the position of the sun relative to the equinoxes.
The Hebrew calendar also contains rules about which day of the week the first day of Passover (Pesach) can fall on: it cannot fall on a Wednesday, Friday, or Sunday. This sometimes forces an extra day to be added or removed from preceding months—another intercalation wrinkle. To calculate Hebrew dates properly, you typically use lookup tables (pre-computed for thousands of years) or an algorithm based on the Metonic cycle combined with rules about new moons and solar positions.
From the developer's perspective, the Hebrew calendar is harder to implement than the Islamic calendar because the rules are context-dependent and involve astronomical calculation. Libraries like hebcal (JavaScript and Python) pre-compute many years of calendar data. If you're storing Hebrew dates in a database, your safest bet is to store both the Hebrew date and a canonical Gregorian equivalent (as an ISO 8601 string or Unix timestamp), so you don't have to recalculate the conversion every time.
Religious holidays in Israel (Passover, Shavuot, Sukkot, etc.) are defined by fixed Hebrew dates but move around the Gregorian calendar year by year. A global HR or event system used in Israel must either pre-compute these dates annually or call an external service that knows the Hebrew calendar inside out.
The Buddhist Calendar and Thai Solar Calendar: Era Dates and Modern Use
The Buddhist calendar is a solar calendar (365 days per year, with leap years matching the Gregorian pattern) but with a different epoch: year 1 in the Buddhist Era (BE) corresponds to the year of the Buddha's birth, traditionally set at 544 BCE in the proleptic Gregorian calendar. Thus, Buddhist Era year 2569 (in 2026) corresponds to 2026 - 543 = 1483 CE (wait—that's wrong; let me recalculate: 2026 CE + 543 = 2569 BE).
This is not a pure offset: it's an additive constant. Thai government offices, legal documents, and some religious contexts use the Buddhist Era. Thailand officially renamed its calendar the "Thai Solar Calendar" in 2018, though the epoch remains the same. The Thai solar calendar is identical to the Gregorian calendar in structure—same months, same leap-year rules—but the year number is offset by +543.
The practical gotcha: a Thai government agency might issue a document dated "20 May 2569 BE." To convert to Gregorian, you simply subtract 543: 2569 - 543 = 2026. But if a system receives this date in ambiguous format (e.g., "2569-05-20"), it might initially misinterpret the year as 2569 CE, which is 543 years in the future.
In Thailand, both calendars coexist. Formal government documents use BE; international business increasingly uses Gregorian. A multinational payroll system serving Thailand should accept both date formats and internally normalize to one representation (typically ISO 8601 Gregorian). The Buddhist Era date conversion is trivial compared to Islamic or Hebrew calendars—just add or subtract 543—but the normalization logic is essential.
Other Buddhist-majority countries (Sri Lanka, Myanmar, Cambodia, Laos) use similar systems with slightly different epoch offsets. For example, Myanmar uses year BE + 1 (so 2026 CE = 2570 Myanmar Buddhist Year). Always verify the specific offset for your target country.
Lunar Calendars Explained: Months, Intercalation, and Synchronization
A lunar calendar tracks the phases of the moon: each month begins with the new moon and lasts either 29 or 30 days (the synodic month averages 29.53 days). The Islamic calendar is a pure lunar calendar; its months truly track lunar phases.
By contrast, a lunisolar calendar like the Hebrew or Chinese calendar combines lunar months with intercalated months to stay synchronized with the solar year and the seasons. This is crucial for agricultural societies: you cannot plant crops by a purely lunar calendar because Ramadan might fall in summer one year and winter the next. But tracking the moon is also astronomically significant and spiritually important in many traditions.
Lunar calendar intercalation is the mechanism for fixing the drift. The most common method is the Metonic cycle (used in Hebrew and traditional Chinese calendars): add an extra month roughly every 2.7 years, so that 19 lunar months are balanced by 7 intercalated months across 19 years. Another method, used historically in China and the traditional Islamic calendar before the tabular system, is astronomical observation: you literally watch the moon and sun and declare a new month when the crescent is sighted.
The Chinese calendar leap month is a concrete example. The Chinese lunisolar calendar has 12 or 13 months per year; when a 13th month is inserted, it's often called an intercalary or leap month. The rule for when to intercalate is complex: roughly, it happens when the lunar year drifts more than 15 days ahead of the solar year. In 2026, there is no leap month in the Chinese calendar; the year has 12 months. In 2023, by contrast, there was a leap month (Leap Month 2, or the second Adar), so the year had 13 months. For scheduling or date-picker UI, this means the set of valid dates changes year to year.
From a conversion perspective, lunar calendar vs solar calendar differences manifest as:
- Lunar calendars have variable year lengths (354–355 days).
- Solar calendars have fixed or predictable year lengths (~365.25 days).
- Lunisolar calendars have variable month and year lengths.
- Conversions require look-up tables or algorithms that handle variable-length periods.
If you're building a date-picker for a Chinese user, you cannot assume each month has a fixed day count. You must validate that the date chosen actually exists in that year's lunisolar calendar.
Epoch Dates Across Systems: When Is 'Year 1' in Each Calendar?
An epoch date is the reference point from which a calendar system counts years. In the Gregorian calendar, the epoch is traditionally set at the birth of Jesus Christ (1 CE), though there's no actual historical record that the dating is precise. In ISO 8601, you can use proleptic Gregorian dates for years before 1 CE (written as negative or with a + prefix for years after 9999).
Different calendar systems have radically different epochs:
- Islamic calendar: Epoch = Hijra (July 16, 622 CE, proleptic Gregorian). Year 1 AH = the first day of Muharram in the Islamic calendar.
- Hebrew calendar: Epoch = Creation (traditionally September 23/24, 3761 BCE, proleptic Gregorian, though the exact calculation varies). Year 1 = Tishrei 1 in that epoch year.
- Buddhist calendar: Epoch = Buddha's birth or nirvana (depending on tradition), standardized at 543 years before the Gregorian epoch. So year 1 BE ≈ 543 BCE.
- Chinese lunisolar calendar: Epoch varies historically, but modern usage often references years relative to the founding of the People's Republic (1949) or, traditionally, the legendary Yellow Emperor (2698 BCE). The latter system is rarely used in software.
The gotcha: proleptic calendar systems extend the rules of a calendar backward to dates before the calendar was actually in use. For example, the proleptic Gregorian calendar applies the Gregorian leap-year rule to all years, including centuries before 1582 when it was adopted. The proleptic Islamic calendar extends the tabular rules backward to year 1 AH, even though the actual calendar may have been adjusted after the Hijra. When storing historical dates or doing retroactive conversion, you must decide: are you using the modern rules (proleptic), or the historically accurate rules that were in force at the time?
For most production systems, proleptic rules are fine: they're predictable and don't change. But if you're building a historical database or a system that must match authoritative records from a specific time period, you need to know which intercalation rules were in effect then.
Conversion Math: Gregorian to Islamic, Hebrew, and Back
Converting between calendar systems requires formulae (for rough estimates) and algorithms (for precise results). Let's cover the mechanics for the most common conversions.
Gregorian to Islamic (Hijri Calendar Calculation)
A simplified formula for converting Gregorian date (Y, M, D) to Islamic:
N = D + 30 × (M − 1) + ⌊(3 × M + 8) / 11⌋ + 365 × (Y − 1) + ⌊(Y − 1) / 4⌋ − ⌊(Y − 1) / 100⌋ + ⌊(Y − 1) / 400⌋
Islamic_Year = ⌊(N − 1) / 10631⌋ × 30 + (remainder calculation using 354 or 355 day rules)
Islamic_Month and Islamic_Day = (remainder) / month_days
This is rough. A more accurate algorithm uses lookup tables or iterates through the tabular calendar's 30-year cycle. The libraries moment-hijri (JavaScript) and python-hijri use this approach. They pre-compute or cache the Gregorian-to-Hijri mapping for a range of years, then interpolate or iterate for the exact date.
Gregorian to Hebrew
Hebrew conversion is more complex because of the variable month lengths and intercalation rules. The standard approach is to use a lookup table or a library like hebcal:
1. Check if the Gregorian year corresponds to a leap year in the Hebrew calendar (year 3, 6, 8, 11, 14, 17, 19 of a 19-year Metonic cycle).
2. For the given Gregorian date, find the corresponding Hebrew month and day using pre-computed tables.
3. Verify the result against known holiday dates (e.g., Passover always falls on 15 Nisan).
The hebcal library, maintained by Danny Sadinoff, is the de facto standard for Hebrew calendar calculations in JavaScript and supports proleptic calculations back to year 1 of the Hebrew calendar.
Gregorian to Buddhist Era
This is trivial:
Buddhist_Year = Gregorian_Year + 543
Buddhist_Month = Gregorian_Month
Buddhist_Day = Gregorian_Day
Just add 543 to the year. The rest of the date is identical.
Reverse Conversions
To convert back to Gregorian, reverse the process:
- Islamic to Gregorian: Use the inverse of the formula above, or the algorithm used by libraries, starting from the Hijri date and computing forward to the Gregorian equivalent.
- Hebrew to Gregorian: Look up the Hebrew date in a pre-computed table, or use algorithms in libraries like
hebcal. - Buddhist to Gregorian: Subtract 543 from the year.
For production systems, do not implement these formulas from scratch unless you have strong mathematical confidence and extensive test coverage. Use a library. The edge cases—leap years, month boundaries, intercalation transitions—are where bugs live.
Challenges in Implementation: Proleptic Calendars, Ambiguous Dates, and Rounding
Building a calendar system that handles multiple calendar types introduces subtleties that seem minor but cause real bugs.
Proleptic calendars and precision: If you extend Islamic calendar rules backward to year 1 AH (622 CE), the math is consistent but historical records may not agree. In practice, this is fine for most applications: the discrepancy is small and largely affects dates before the 1900s. However, if you're building archival or historical software, you must document which rules you're using.
Ambiguous dates: A date like "15 Nisan" is ambiguous without a year. But a date like "5786" (Hebrew year alone) is also ambiguous: it spans roughly September 2025 to September 2026 in the Gregorian calendar, overlapping two Gregorian years. If a user says "I want to book a room for the whole year 5786," do they mean from 1 Tishrei 5786 to 29 Elul 5786 (the Hebrew calendar boundaries)? Or the civil calendar? Your API and UI must make this clear.
Rounding and boundaries: When converting dates, you'll often encounter fractional days or moments that don't align neatly. For example, the Islamic month begins with the sighting of the crescent moon, which can occur at different local times in different regions. If you're rounding a conversion to midnight UTC, you might get a different day than if you round to local time. Store the UTC and timekeeping standards and your time zone carefully.
Conversion libraries and version skew: The moment.js library and its Hijri plugin (moment-hijri) are widely used but not always synchronized with official calendars. As of 2026, moment.js is in maintenance mode (no new features), and the Hijri calculations may not match the latest Saudi or Egyptian official tables. Always verify against an authoritative source for your jurisdiction.
Real-World Scenarios: APIs, Database Schemas, and Date Pickers Across Calendars
Let's walk through concrete implementation problems.
Scenario 1: International Payroll System
A company has employees in Saudi Arabia, Israel, and Thailand. You need to process payroll monthly and respect local holidays.
Challenge: A Saudi employee's salary is processed every month by the Islamic calendar. An Israeli employee's salary is processed monthly, but bonuses are paid on Hebrew national holidays (which shift around the Gregorian calendar). A Thai employee is paid on the first of each Gregorian month.
Solution:
- Store all dates internally as ISO 8601 Gregorian dates (or Unix timestamps, which are agnostic).
- For each employee record, store their local calendar system preference.
- When displaying a payroll date to the employee, convert from Gregorian to their local calendar for display only.
- When accepting input (e.g., a Saudi manager wants to schedule a bonus for "15 Shawwal"), parse the input using a calendar-aware date parser, convert to Gregorian internally, and store.
- For holiday scheduling, maintain a lookup table: for each year and region, list the Gregorian dates of local holidays. Update this table annually or call an external service (like the one used by
hebcalor a custom API).
Database schema:
CREATE TABLE employees (
id INT PRIMARY KEY,
name VARCHAR(255),
local_calendar ENUM('gregorian', 'islamic', 'hebrew', 'buddhist'),
payroll_period VARCHAR(50) -- 'monthly', 'every_15_hijri_days', etc.
);
CREATE TABLE holidays (
region VARCHAR(50),
gregorian_date DATE,
local_calendar_date VARCHAR(50), -- e.g., "15 Nisan 5786"
holiday_name VARCHAR(255),
UNIQUE(region, gregorian_date)
);
Scenario 2: Event Scheduling for a Global Team
A team spans San Francisco, Cairo, Tel Aviv, and Bangkok. You're building a calendar widget to schedule a recurring meeting.
Challenge: A meeting is scheduled for "every Tuesday, 10 AM local time." But "Tuesday" is the same day globally (UTC-based), whereas "local time" differs. Additionally, if the team wants to respect local holidays (no meetings on Yom Kippur, Eid al-Fitr, etc.), the dates of those holidays vary by calendar system.
Solution:
- Store meeting times in ISO 8601 date format with explicit time zones. Use IANA time zone database identifiers:
2026-06-12T10:00:00-07:00[America/Los_Angeles], etc. - When displaying a meeting to a user, convert the ISO time to their local time zone and local calendar (if non-Gregorian).
- For recurring meetings, compute occurrences in UTC, then convert to each participant's local time and calendar.
- When checking for conflicts with local holidays, look up the holiday dates for each participant's region and exclude them from the recurrence rule.
A date-picker UI might look like:
Display: "Tuesday, June 12, 2026 (6 Sha'ban 1447 AH)"
Local time: "10:00 AM" (shown in user's local time zone)
Holiday alert: "Note: June 14 (Eid al-Fitr) is a holiday in Saudi Arabia."
Scenario 3: Database of Historical Events
You're building a historical archive that must display events in their original calendar system as well as in proleptic Gregorian.
Challenge: An event was recorded as "25 Elul 5100" by a Jewish scholar, and as "October 12, 1340 CE" by a Christian chronicler. Are these the same day? You need to verify and store both representations.
Solution:
- Compute the Gregorian equivalent of each original date using a proleptic calendar algorithm.
- Store both the original date (as a string) and the canonical Gregorian date.
- When querying, allow searching by either date system.
- Document your conversion algorithm and library in the system's metadata.
Libraries and Tools: ICU, moment-hijri, and Building Your Own Converter
Several libraries handle non-Gregorian calendars, each with trade-offs.
ICU (International Components for Unicode): The heavyweight option. ICU is a massive C/C++ library (with bindings to Java, JavaScript via icu4j or Node bindings) that handles calendars, localization, collation, and more. It supports Islamic, Hebrew, Chinese, Buddhist, and Coptic calendars out of the box. It's standards-compliant and well-maintained.
Pros: Comprehensive, heavily tested, official standard. Cons: Large footprint, complex API, overkill if you only need one or two calendar systems.
moment-hijri: A moment.js plugin that adds Hijri calendar support. As of 2026, moment.js itself is in maintenance mode, so this library is unlikely to receive new features.
Pros: Simple API if you already use moment.js.
Cons: Outdated (no active development), may not reflect the latest official Hijri calendars.
hebcal: A JavaScript (and Python) library specialized in Hebrew calendar calculations. Maintained actively, includes holiday data for Israel.
Pros: Excellent for Hebrew calendars, actively maintained, includes real-world holiday data. Cons: Hebrew-specific, not suitable if you need multiple calendars.
java.time (Java): The built-in java.time package (since Java 8) includes support for Buddhist, Islamic, and other calendars via the ChronoLocalDate interface and the Chronology class hierarchy.
Pros: Built-in, no external dependencies. Cons: Not all calendars, and the API is complex.
Building your own: If you only need Islamic-to-Gregorian or Buddhist-to-Gregorian conversion and want to minimize dependencies, you can implement it yourself using the tabular calendar rules and a lookup table for the next 50–100 years. Store pre-computed dates or use a simple iterative algorithm. This is viable for many production systems, especially if you don't need historical dates or complex intercalation.
Example: a minimal Islamic-to-Gregorian converter in Python using the tabular calendar:
def hijri_to_gregorian(hijri_year, hijri_month, hijri_day):
# Simplified: compute days since Hijra epoch, convert to Gregorian
hijra_epoch_jd = 1948440 # Julian Day for July 16, 622 CE
days_in_hijri_year = [355, 354, 354, 354, 355, 354, 354, 354, 355, 354, 354, 354] # varies per year
# Iterate and accumulate days...
# Return Gregorian date
For production, always test against a known reference (e.g., official government calendar tables or a reputable library) and document the limits of your conversion.
Frequently Asked Questions
What's the difference between a lunar calendar and a lunisolar calendar?
A lunar calendar tracks only the moon: 12 months of 29–30 days, totaling ~354 days per year. The Islamic calendar is purely lunar. A lunisolar calendar combines lunar months with intercalated months to stay aligned with the solar year and seasons. Hebrew and Chinese calendars are lunisolar: most years have 12 months, but every few years an extra month is inserted.
Why do Islamic holidays move around the Gregorian calendar every year?
The Islamic calendar is purely lunar and has no intercalation. Its 354-day year is ~11 days shorter than the Gregorian 365-day year. Over time, Islamic months drift relative to the Gregorian calendar, cycling through all seasons every ~33 years. Ramadan and other Islamic holidays are tied to Islamic months, so they appear to move backward through the Gregorian calendar.
How do I convert a Hebrew year to a Gregorian year?
Hebrew year = Gregorian year + 3761 (roughly). But this is an approximation. The exact conversion depends on which Hebrew month you're in, because Hebrew years can begin in September or October. Use a library like hebcal for precise conversion. For example, Hebrew year 5786 spans roughly September 2025 to September 2026 CE.
Is the Buddhist Era the same across all Buddhist countries?
No. Most use BE, which adds 543 to the Gregorian year. But Myanmar and some other countries use slightly different offsets. Thailand officially uses the "Thai Solar Calendar" with a +543 offset. Always verify the specific country or region's convention.
Can I store a non-Gregorian date in a standard SQL DATE column?
You can store the Gregorian equivalent in a standard DATE column. But if you also need to preserve the original date in its native calendar system, store it as a separate string column or as a JSON object with both representations. Never lose the original date representation, because reverse conversion can introduce rounding errors.
How do I handle date pickers for multiple calendar systems in a web app?
Provide separate input fields or a dropdown to select the calendar system. When the user picks a date in their native calendar, immediately convert to ISO 8601 Gregorian internally for storage. When displaying the date back to the user, convert from Gregorian to their selected calendar. Libraries like date-fns (with locale-aware plugins) or custom components can handle this.
What's a proleptic calendar, and do I need to worry about it?
A proleptic calendar applies the same rules backward to dates before the calendar was officially adopted. The proleptic Gregorian calendar, for example, applies Gregorian leap-year rules to all years, including before 1582. For most modern applications, this is fine. For historical data or archival systems, document which rules you're using.
Why is leap-month insertion in the Chinese calendar so complex?
The Chinese lunisolar calendar must stay synchronized with the solar year and the seasons (crucial for agriculture). A leap month (a second occurrence of an earlier month) is inserted roughly every 2–3 years, but the exact timing depends on when the solar terms (24 divisions of the solar year) fall relative to lunar months. This requires astronomical or pre-computed data, not just a simple formula.
How do I know if a date is valid in the Hebrew calendar?
Check whether the year is a leap year (has Adar I), and whether the specific month and day exist. In non-leap years, Adar I doesn't exist, so "5 Adar I" is invalid. Some years have 29-day Heshvan, others 30. Use a library or a pre-computed lookup table. Never assume a date is valid without checking.
Should I rely on a single library for all calendar conversions?
No. Different libraries have different strengths (e.g., hebcal for Hebrew, moment-hijri for Islamic). For a multi-calendar system, use specialized libraries and validate the results against authoritative sources (government calendar tables, official holiday lists). Cross-check conversions for critical dates.
Bottom Line
Non-Gregorian calendars are not exotic: they're legally and religiously significant across much of the world and affect real production systems every day. The Islamic calendar is purely lunar with a 30-year intercalation cycle; the Hebrew calendar is lunisolar with a 19-year cycle and complex month-length rules; the Buddhist calendar is solar but offset by 543 years; and the Chinese lunar calendar inserts leap months based on solar alignment. Converting between them requires algorithms, lookup tables, or libraries, and it's worth testing thoroughly—the cost of getting a date wrong can be significant for international HR, event scheduling, or compliance systems. Store dates internally in a canonical format (epoch time and date representation like ISO 8601 Gregorian or Unix timestamps), validate conversions against authoritative sources, and document the limitations of your approach. When coordinating across time zones and calendars, align on distributed team scheduling across regions practices that acknowledge both. Use battle-tested libraries (ICU, hebcal, Java's java.time) rather than building converters from scratch, unless you have a very narrow use case and strong confidence in testing.
We build practical, free time and date tools at epochcalc.com — every calculation runs in your browser using IANA tzdb via Luxon, so DST and zone math are correct by construction.