Khmer Calendar Algorithm

The following calculation is from “Pratitin Soryakkatik-Chankatik 1900-1999” by Mr. Roath Kim Soeun. It illustrates how to determine if a given year is a normal year, leap-day year, or leap-month year. The calculation can use different eras including Buddhist Era, Jola Sakaraj but not AD. Here we choose to use only Buddhist Era.

Calculation

The calculation here is concerned with determining if a given year is a normal Lunisolar year (354 days), or leap-day year (355 days) or a leap-month year (384 days).

Khmer Solar Leap

We first begin defining Khmer Solar Leap year (determine if a year has 365 or 366 days). This is calculation is different than how Gregorian leap year.

If Kromthupul is less than or equal 207, then it is a Khmer Solar leap year (366-day year).

Aharkun_mod = (be_year * 292207 + 499) mod 800;
Kromthupul = 800 - Aharkun_mod

 

Avoman: អាវមាន

Avoman determines if a given year is a leap-day year. Given a year in Buddhist Era as denoted as be_year:

 avoman = (Aharkun(be_year) * 11 + 25) mod 692

Based on the avoman value, leap-day year is detemined as follow:

  • If it is Khmer solar leap year and Avoman is less than 127 then it is a leap-day year.
  • If it is non-Khmer solar leap year:
    • if Avoman is less than 138, then it is a leap-day year.
    • if Avoman is 137 and the next year has Avoman 0, then the year with Avoman 137 is a normal year and the year with Avoman 0 is a leap-day year.
  • Else it is not a leap-day year.

 

Aharkun: អាហារគុណ ឬ ហារគុណ

Aharkun is used for Avoman and Bodithey calculation below. Given be_year as a target year in Buddhist Era:

 aharkun = ⌊(be_year * 292207 + 499) / 800⌋ + 4

Notes: ⌊ ⌋ is a floor function.

 

Bodithey: បូតិថី

Bodithey determines if a given year is a leap-month year. Given be_year target year in Buddhist Era:

 a = Aharkun(be_year)
 temp = ⌊(a * 11 + 25) / 692⌋
 bodithey = (temp + a + 29) mod 30

If Bodithey is greater than 24 or less than 6, then the year is a leap-month. Else it is not a leap-month.

 

Special Cases:

  • If Bodithey is 24 and the next year is 6, then Bodithey 24 year is a leap-month year.
  • If Bodithey is 25 and the next year is 5, then Bodithey 25 year is not a leap-month year.

     

    Bodithey Leap vs. Protetin Leap

    There are two approaches for identifying leap year, Bodithey leap and Protetin leap.

    Bodithey leap uses Avoman to determine if a year a leap-day year. It also uses Bodithey to determine if a year is leap-month year. Thus, the result can be both leap-day and leap-month year. So there are four possible types:

    1. normal year
    2. leap-month year
    3. leap-day year
    4. leap-month and leap-day year
    On the other hand, the actual Khmer calendar year cannot have both leap-month and leap-day year. We call this Protetin leap, which only has three types: normal, leap-month or leap-day year.

     

    So when Bodithey leap found a year to be both leap-month and leap-day year, that year will represent in the Protetin leap as only a leap-month year. Then we move the leap-day year to next year.

    So when checking for Protetin leap for a particular year, it is neccessary to check the previous year for Bodithey leap. If the previous year is of type four, then the current year is a leap-day year.

    Calendar Data

    The calculation done here in the monthly calendar is to use AD. So first we need to convert the AD year to BE. Notice that BE year is AD – 544.

    Here are the calculation from 2000 AD to 2020 AD.

    Year in ADYear in BEAharkunAvomanBoditheyBod. LeapCal. Leap
    2000254492922262711N
    2001254592958850123NN
    200225469299533644MM
    2003254793031822715NN
    200425489306839026MDM
    200525499310496567ND
    2006255093141451918NN
    2007255193177938229MM
    2008255293214424510NN
    2009255393251011922DD
    201025549328756742MM
    2011255593324053713NN
    2012255693360540024MM
    201325579339712746NN
    2014255893433613717NN
    20152559934701028MDM
    201625609350675669ND
    2017256193543242920NN
    201825629357972921MM
    2019256393616215512NN
    202025649365282924DD

    Notes:
    Bod. Leap: Bodithey Leap (N:Normal, D:Leap Day, M:Leap Month, MD:Month and Day)
    Cal. Leap: Calendar Leap (N:Normal, D:Leap Day, M:Leap Month)