## Saturday, June 15, 2013

### Algorithm, Program and Calculation of Myanmar Calendar

မြန်မာဘာသာ ဖြင့်ဖတ်ရန်

An easier and faster modern method to calculate a past, present or future date in the Myanmar calendar (the Burmese calendar) is presented. The constants, formulas and steps are clearly defined to derive all the essential elements of the Myanmar calendar such as Myanmar year, Myanmar month, waxing or waning moon and day. Unlike the existing methods, this method is easy even for a person who is not familiar with the Myanmar calendar and its terms.

### 1. Introduction

There are a few reasons for developing this new Myanmar calendar calculation method. Firstly, we have not found any simple and precise Myanmar calendar calculation method until now. When we made literature review, some say that it is not possible to calculate the exact days for the future years in the Myanmar calendar and some say it is only possible to calculate a few years in advance.
U Ohn Kyaing [Kyaing, 1964], p-290, stated "There is no method to prepare the Myanmar calendar for the future years although it is possible in the Gregorian calendar. There is no exact number to determine intercalary months and intercalary days. Years with the intercalary month can be used in the calendar only after the government has announced it. That is why, it is not possible to prepare the future years for the Myanmar calendar."
Our method in this article only depends on the full moon day of Second Waso and, consequently, it is possible to calculate the future years for the Myanmar calendar. But officially announced dates still depend on the government Myanmar Calendar Advisory Board.

Secondly, the current calculation of the Myanmar calendar involves complex procedures and the understanding of difficult terms. Ancient scholars thought of not only how to calculate the calendrical days but also the ways to overcome difficulties in numerical computations. In modern days, by using a computer for calculation, we can simplify their methods by discarding the steps which were meant to make manual calculations easier. Our method only needs to know Solar Year and Lunar Month. All the calculations are based on these two constants. Precise and easy steps are mentioned clearly. We hope that this method can be used by everybody without any difficulty.

Thirdly, the efficiency and speed of the calculations are considered. About 50 years ago, U Ohn Kyaing [Kyaing, 1964], p-206, once stated "Years with the intercalary day are very difficult to determine in advance. It will cost a lot of time and money. The government Myanmar Calendar Advisory Board once tried to calculate for the future 50 years in the Myanmar calendar and it cost a lot of money." Therefore, it looks the present calculation methods requires difficult and repetitive procedures. Our method does not require any repetitive procedure and it can calculate any date of the Myanmar calendar in a few steps.

Existing Myanmar calendar calculation methods do not consider conversion from Myanmar calendar dates to Gregorian calendar dates or vice versa. In this article, we have presented bidirectional coversion between Myanmar calendar dates and other calendar dates with the equations for it.

We describe not only the algorithm but also the computer program and example calculations for the Myanmar calendar. Some of the existing Myanmar calendar programs are based on the program of Wunna Ko [Ko, 2009]. It uses Julian Day Number (JDN) to calculate the day count. But that program does not calculate whether a Myanmar year has the intercalary month or the intercalary day. Our program which is presented in this article calculates all the essential elements of the Myanmar calendar completely.

All the calculations are based on Myanmar Standard Time (UTC+06:30) which is calculated on the basis of 97° 30' longitude.

### 2. Julian Day Number

For the calculation of calendars such as the Myanmar calendar, it is convenient to calculate based on number of days. When counting the number of days, it is necessary to define a starting date called epoch. A popular day counting system used by astronomers is Julian Day Number (JDN). Julian Day Number is the day count starting from noon November 24, 4714 BC in the Gregorian calendar. A method to calculate Julian Day Number from a Gregorian date [UTSA, 2011] is shown below. The operation called floor takes the integer part of a number and discards its decimal part. For example, the result of floor(3.2)=$$\lfloor 3.2 \rfloor$$ is 3.
\begin{align} a &= \lfloor \frac{14-month}{12} \rfloor \\ y &=year+4800-a \\ m &=month+12 a-3 \\ jdn &=day+\lfloor \frac{153 m+2}{5} \rfloor + 365 y+\lfloor \frac{y}{4} \rfloor - \lfloor \frac{y}{100} \rfloor +\lfloor \frac{y}{400} \rfloor -32045 \end{align} where $$jdn$$ = Julian Day Number.

A method which can be used to convert a Julian Day Number to the corresponding Gregorian date [Myers, 2011] is also shown below.
\begin{align} j&=j-1721119 \\ y&=\lfloor{\frac{4j-1}{146097}}\rfloor \\ j&=4 j - 1 - 146097 y \\ d&=\lfloor \frac{j}{4} \rfloor \\ j&=\lfloor \frac{4d+3}{1461} \rfloor \\ d&=4 d+ 3 - 1461 j \\ d&=\lfloor \frac{d+4}{4} \rfloor \\ m&=\lfloor \frac{5d-3}{153} \rfloor \\ d&=5 d -3 - 153 m \\ d&=\lfloor \frac{d+5}{5} \rfloor \\ y&=100 y+j \\ & \text{if m<10 then} \\ & m=m+3 \\ & \text{else} \\ & m=m-9 \\ & y=y+1 \\ & \text{end if} \end{align} where $$y$$ = year; $$m$$ = month; $$d$$= day; $$j$$ = Julian Day Number.

Example: Find the Julian Day Number for 2000 CE January 1.

Solution:
year = 2000
month = 1
day = 1
a = floor((14-month)/12) = 1
y = year+4800-a = 2000+4800-1 = 6799
m = month+12a-3 = 1+12-3 = 10
jdn = 1+306+365*6799+1699-67+16-32045
= 2451545

The Julian Day Number (JDN) is obtained as 2451545. If you don't want to calculate manually, you can find a Julian Day Number converter at the link below.

Julian Date Converter >>

Julian Date is Julian Day Number with fractional part where it takes account hour, minute and second. The hour is divided by 24 to convert to day. The minute and the second are also divided with the corresponding numbers. Since Julian Day Number is started at noon, 12 is subtracted from the hour before the division.
The fraction of day, denoted by $$df$$, which results from converting hour $$h$$, minute $$n$$, and second $$s$$ to day, is obtained as follow. $$df = \frac{h-12}{24} + \frac{n}{1440} + \frac{s}{86400}$$ Then, Julian date can be represented as follow. $$jd = jdn + df$$ The relation between Julian day number and Julian date is as follow, where round(x) = $$\lfloor x \rceil$$ is the operation that takes the nearest integer (rounding). $$jdn = \lfloor jd \rceil$$

Example: Find Julian date for 2000 CE, January 1, 6:00 pm.

Solution:
Julian day number for 2000 CE, January 1 is 2451545.
24 hour format for 6:00 pm is 18:00.
The fraction of day started from 12 noon is ( 18 - 12 ) / 24 = 0.25 day.
Therefore, Julian date is 2451545 + 0.25 = 2451545.25 .

To convert a Julian Date to Gregorian Date, a converter can be found at the following link.

Julian Date to Western Date Converter >>

In the book, Myanmar - English Calendar by Tin Naing Toe, detailed information about the past Myanmar years from 1 ME to 1352 ME is described [Toe, 1999]. There are also some historical dates mentioned in that book. Before Britain and the British Empire, including the United States, adopted the Gregorian calendar, most of the dates found as historical evidence are in Julian calendar dates. It looks the Julian calendar was prevalent in Myanmar (Burma) at that time. We believe, English - Myanmar calendar will be more useful than Gregorian - Myanmar calendar to those who want to look these old dates. In the English calendar, the Julian calendar date 1752 September 2 is followed by the Gregorian calendar date 1752 September 14 by dropping 11 days. A method to convert Julian calendar date to Julian day number is shown below.
\begin{align} a &= \lfloor \frac{14-month}{12} \rfloor \\ y &=year+4800-a \\ m &=month+12 a-3 \\ jdn &=day+\lfloor \frac{153 m+2}{5} \rfloor + 365 y+\lfloor \frac{y}{4} \rfloor -32083 \end{align} where $$jdn$$ = Julian Day Number.

To convert Julian day number into Julian calendar date, the method by Jefferys [Jefferys, 1998] is shown below.

\begin{align} b &= jdn + 1524 \\ c &=\lfloor \frac{b-122.1}{365.25} \rfloor \\ f &=\lfloor 365.25 \times c \rfloor \\ e &=\lfloor \frac{b-f}{30.6001} \rfloor \\ & \text{if e>13 then} \\ & m=e-13 \\ & \text{else} \\ & m=e-1 \\ & \text{end if} \\ d &=b-f-\lfloor 30.6001*e \rfloor \\ & \text{if m<3 then} \\ & y=c-4715 \\ & \text{else} \\ & y=c-4716 \\ & \text{end if} \end{align} where $$y$$ = year; $$m$$ = month; $$d$$= day; $$jdn$$ = Julian Day Number.

The javascript code for converting to and from Julian Day Number is shown below.
//Julian date to Western date
//Credit4 Gregorian date: http://pmyers.pcug.org.au/General/JulianDates.htm
//Credit4 Julian Calendar: http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html
//input: (jd:julian date,
// ct:calendar type [Optional argument: 0=english (default), 1=Gregorian, 2=Julian]
// SG: Beginning of Gregorian calendar in JDN [Optional argument: (default=2361222)])
//output: Western date (y=year, m=month, d=day, h=hour, n=minute, s=second)
function j2w(jd,ct,SG) {
ct=ct||0; SG=SG||2361222;//Gregorian start in English calendar (1752/Sep/14)
var j,jf,y,m,d,h,n,s;
if (ct==2 || (ct==0 && (jd < SG))) {
var b,c,f,e;
j=Math.floor(jd+0.5); jf=jd+0.5-j;
b=j+1524; c=Math.floor((b-122.1)/365.25); f=Math.floor(365.25*c);
e=Math.floor((b-f)/30.6001); m=(e > 13)?(e-13):(e-1);
d=b-f-Math.floor(30.6001*e); y=m < 3 ? (c-4715) : (c-4716);
}
else{
j=Math.floor(jd+0.5); jf=jd+0.5-j; j-=1721119;
y=Math.floor((4*j-1)/146097); j=4*j-1-146097*y; d=Math.floor(j/4);
j=Math.floor((4*d+3)/1461); d=4*d+3-1461*j;
d=Math.floor((d+4)/4); m=Math.floor((5*d-3)/153); d=5*d-3-153*m;
d=Math.floor((d+5)/5); y=100*y+j;
if(m<10) {m+=3;}
else {m-=9; y=y+1;}
}
jf*=24; h=Math.floor(jf); jf=(jf-h)*60; n=Math.floor(jf); s=(jf-n)*60;
return {y:y,m:m,d:d,h:h,n:n,s:s};
}


//Western date to Julian day number
//Credit4 Gregorian2JD: http://www.cs.utsa.edu/~cs1063/projects/Spring2011/Project1/jdn-explanation.html
//input: (y: year, m: month, d: day,
// ct:calendar type [Optional argument: 0=english (default), 1=Gregorian, 2=Julian]
// SG: Beginning of Gregorian calendar in JDN [Optional argument: (default=2361222)])
//output: Julian day number
function w2j(y,m,d,ct,SG) {
ct=ct||0; SG=SG||2361222;//Gregorian start in English calendar (1752/Sep/14)
var a=Math.floor((14-m)/12); y=y+4800-a; m=m+(12*a)-3;
var jd=d+Math.floor((153*m+2)/5)+(365*y)+Math.floor(y/4);
if (ct==1) jd=jd-Math.floor(y/100)+Math.floor(y/400)-32045;
else if (ct==2) jd=jd-32083;
else {
jd=jd-Math.floor(y/100)+Math.floor(y/400)-32045;
if(jdSG) jd=SG;
}
}
return jd;
}
//-------------------------------------------------------------------------
//Time to Fraction of day starting from 12 noon
//input: (h=hour, n=minute, s=second) output: (d: fraction of day)
function t2d(h,n,s) { return ((h-12)/24+n/1440+s/86400);}
//-------------------------------------------------------------------------


### 3. Myanmar Year

The length of a solar year in the Myanmar calendar is defined as 1577917828/4320000 (365.2587565) days [Irwin, 1909]. It is denoted by $$SY$$.
$$SY = 1577917828 / 4320000$$ The beginning of a year is obtained by adding that constant to the beginning of the previous year. The starting time of the Myanmar year zero is denoted by $$MO$$. Using these two constants, the beginning of any Myanmar year can be expressed by using the following equation.
$$ja = SY . my + MO$$ where my is the Myanmar year and $$ja$$ is the Julian Date value of its starting time. Starting time of a few recent Myanmar years can be found in recently published calendars. Substituting a few known values in $$ja$$ and taking average, $$MO$$ is estimated as Julian Date 1954168.050623.

Example: Find the starting time of 1375 ME.

Solution:
my = 1375
ja = SY * 1375 + MO
= 365.2587565*1375+1954168.0506
= 2456398.8407875

Therefore its starting time in Julian Date is 2456398.8407875. The corresponding Gregorian date is found as 2013-Apr-16 08:10 am.
Julian Date to Western Date Converter can also be used for the conversion.

The Myanmar new year festival (the water festival) is called the Thingyan. A typical Myanmar calendar mentions the beginning of the year called the atat time and it is the end of the Thingyan. The starting time of the Thingyan is called the akya time. The length of the Thingyan currently recognized by Myanmar Calendar Advisory Board is 2.169918982 days ( 2days, 4 hours, 4 minutes and 41 seconds). When the time of ancient Myanmar kings, 2.1675 days (2 days, 4 hours, 1 min and 12 seconds) was used as the length of the Thingyan. Therefore, the akya time can be obtained by subtracting 2.169918982 days from the atat time. Before the new system by Myanmar Calendar Advisory Board (1312 ME, 1950 CE) , 2.1675 days should be subtracted from the atat time to obtain the akya time. The akya time in Julian date $$jk$$ can be calculated as follows.

\begin{align} &\text{if (my >= 1312) then} \\ & jk = ja - 2.169918982 \\ &\text{else} \\ & jk = ja - 2.1675 \\ &\text{end if} \end{align}
The days in the Myanmar calendar begin at midnight [Irwin, 1901] p-7. The day on which the akya time falls is called the akya day and the corresponding day for the atat time is called the atat day. The days between the akya day and the atat day are called akyat days. Since the difference between the atat time and the akya time is more than 2 days, the number of akyat days can be 1 or 2 depending on how the atat day and the akya day fall. The day before the akya day is called the akyo day (the Thingyan eve). Since a part of the atat day is in old year and the other part in new year, the atat day is not called as new year's day. Only the day after the atat day is called new year's day. A calculator that produces beginning of year, the akya time, the akyo day, akya day(s), the akyat day, the atat day and the new year's day for any given Myanmar year in Gregorian date is found at the following link.

Thingyan Calculator >>

The javascript code that calculates the Thingyan is shown below.
//Calculate the Thingyan (Myanmar new year)
//input: (my -myanmar year)
//output: (ja: atat time, jk: akya time, da: atat day, dk: akya day)
function ThingyanTime(my) {
var SY=1577917828/4320000; //solar year (365.2587565)
var LM=1577917828/53433336; //lunar month (29.53058795)
var MO=1954168.050623; //beginning of 0 ME
var SE3=1312; //beginning of 3rd Era
ja=SY*my+MO; if (my >= SE3) jk=ja-2.169918982; else jk=ja-2.1675;
return {ja:ja,jk:jk,da:Math.round(ja),dk:Math.round(jk)};
}


On the other hand, Myanmar year that corresponds to a Julian Day Number can be obtained as follows.
$$my=\lfloor \frac{ jd - 0.5 - MO}{SY} \rfloor$$
Only the day after the atat day is the new year day and it is the reason for subtracting 0.5 from the day number.

For example, we have known that Julian Day Number for 2000 January 1 is 2451545, the corresponding Myanmar year is (2451545-0.5-1954168.0506)/365.2587565= 1361.7098. Taking floor operation gives Myanmar year 1361.

The origin of the Myanmar calendar is the old Hindu calendar. Therefore, year in the Myanmar calendar is started counting from the start of an era called Kali Yuga. Some Myanmar kings reset the year number to zero. Therefore, the Kali Yuga year and the Myanmar year are different. The Kali Yuga year number can be obtained by adding 3739 to the Myanmar year.
$$ky = my + 3739$$
where $$ky$$ is Kali Yuga year and $$my$$ is Myanmar year. The start of Kali Yuga in the Myanmar calendar is found to be 588465.560139 in Julian date. \begin{align} ky &=0 \\ my& = ky -3739 = -3739 \\ ja &= SY * (-3739) + MO \\ & = 588465.560139 \end{align} Dershowitz mentions the start of Kali Yuga in the old Hindu calendar is Friday, January 23, -3101 (Gregorian) [Dershowitz, 2008]. The starting mid night of that day corresponds to 588465.5 in Julian date. Therefore, there is a few hours difference from the start of Kali Yuga in the Myanmar calendar. He also mentions that the start of the old Hindu lunisolar calendar is about one month (28.62294 days) earlier than the start of the Kali Yuga. But, in the Myanmar calendar, the start of calendar and the start of the Kali Yuga seem to be at the same time. The corresponding Gregorian date for Julian date 588465.560139 is Friday, January 23, -3101, 1:26:36 am. The reason for that time discrepancy is the time difference between the reference location for the old Hindu calendar (Ujjain) and the reference location for the Myanmar calendar. The time difference, 1 hour 26 minute and 36 seconds, is exactly the same as mentioned by Saya U Aye Win Kyaw in jotisa Vedic magazine [Nyein, 2014, p.190]. Nyein [Nyein, 2012] stated that the time difference between these two locations is 1 hour, 26 minutes and 53.52 seconds which is a few seconds different from our result. According to Baddanta Thadiya (Chairman, Myanmar Calendar Advisory Board), the reference location, Ujjain, was temporarily agreed to be at 76° 06' by board members. [Thadiya, 2010]. If the Julian date is denoted by $$jd$$ and the the number of days started counting from Kali Yuga epoch is denoted by $$kd$$, their relationship is found as follow.
$$kd = jd - 588465.560139$$
Typical Myanmar calendars usually mention the year in Buddhist Era (BE) also. The Buddhist Era began in 543 BC [Clancey, 1906]. The relation between Buddhist Era year and Myanmar year is as follow. The months and the days are same in the both calendars.
$$by = my + 1182$$
where $$by$$ is year in Buddhist Era and $$my$$ is Myanmar year.

### 4. Intercalary month

A common year in the Myanmar calendar has 12 months. The odd number months have 29 days and the even number months have 30 days. The names of Myanmar months, the number of days in each month and the month numbers are shown in the following table.

The months in common Myanmar year.
Total354
Tagu291
Kason302
Nayon293
Waso304Beginning of Buddhist lent. The moon is within the nekkat Athanli.
Wagaung295
Tawthalin306
Tazaungmon308
Pyatho3010
Tabodwe2911
Tabaung3012

A year with intercalary month has 13 months and it is called watat year. The intercalary month has 30 days and it is always added before Waso. That is why, the intercalary month is called First Waso. If a year has the intercalary month only, it is called little watat year. If a year has both the intercalary moth and the intercalary day, it is called big watat year. A common year never has the intercalary day. In a big watat year, the intercalary day is always added before First Waso as the last day in Nayon. Therefore, Nayon has 30 days in big watat years and it has only 29 days in other years. The months in a little watat year and the months in a big watat year are shown in the following tables.

The months in a little watat year (a year with the intercalary month).
Total 384
Tagu291
Kason302
Nayon293
First Waso300 Added month to adjust the full moon day of Waso with the nekkat Athanli.
Second Waso304Beginning of Buddhist lent. The moon is within the nekkat Athanli.
Wagaung295
Tawthalin306
Tazaungmon308
Pyatho3010
Tabodwe2911
Tabaung3012

The months in a big watat year (a year with both the intercalary month and the intercalary day).
Total 385
Tagu291
Kason302
Nayon 30 3 If not a big watat year, Nayon has only 29 days.
Intercalary day which is present only in a big watat year.
First Waso300 Intercalary month to adjust the full moon day of Waso with the nekkat Athanli.
Second Waso304 Beginning of Buddhist lent. The moon is within the nekkat Athanli.
Wagaung295
Tawthalin306
Tazaungmon308
Pyatho3010
Tabodwe2911
Tabaung3012

The length of a lunar month in the Myanmar calendar is defined as 1577917828/53433336 (29.53058795) days [Irwin, 1909]. That constant is denoted by $$LM$$. $$LM = 1577917828 / 53433336$$ The length of a solar year in the Myanmar calendar, $$SY$$, is 365.2587565 days. The total number of days for twelve lunar months, $$12 \times LM$$, is only 354.3670554 days. Therefore, there is 10.8917011 excess days per year. We will define mod as an operation that givels the remainder of a floating point number when divided by another floating point number. Its operation can be mathematically expressed as follows.
$$\text{x mod y} = x - y . \lfloor \frac{x}{y} \rfloor$$
For example, 7 mod 3 is 1. Again, 3.3 mod 1.4 results the remainder of 0.5. $$SY$$ mod $$LM$$ is equal to 10.8917011. The number of excess days at the New Year time determines whether a year has the intercalary month or not. The excess days is the number of days between the starting time of the year and the start of the month before. The heap of days started counting from Kali Yuga epoch is $$SY$$ times Kali Yuga years. If it is divided by $$LM$$, the remainder is the excess day for that year. The excess days $$ed$$ of the Myanmar year $$my$$ can be calculated as follows.
$$ed =( SY ( my + 3739 ) ) \text{ mod } LM$$
There are three eras in the Myanmar calendar. These eras and their descriptions are shown in the following table.

The Myanmar Calendar Eras
Era Description Definition
The first era The era of Myanmar kings 1216 ME (1854 CE) and before
The second era The era under British colony 1217 ME - 1311 ME (1855 CE - 1949 CE)
The third era The era after Independence 1312 ME (1950 CE) and after

#### 4.1 Intercalary Months in the Third Era

The third era is the era after independence of Myanmar from British colony. It is the current era and it uses the calculation method by Myanmar Calendar Advisory Board. If the number of excess days becomes the full lunar month $$LM$$ within the first 8 months of a year, it is the year with the intercalary month. If the excess days becomes the full lunar month only within the last 4 months, the following year is the year with the intercalary month. The number of months that defines the time to determine the intercalary month , denoted by $$NM$$, for the third era is $$NM = 8 .$$ The number of excess days for a solar year is $$SY- 12 \times LM$$. When it is divided by 12, the excess days per solar month, $$\frac{SY}{12} -LM$$ = 0.9076417, is obtained. To check whether the excess days accumulated has been the full lunar month during the past 4 months before the beginning of the current year, the number of excess days at the starting time of the year can be compared with the number of excess days for 4 months. If smaller, it needs to be adjusted by adding $$LM$$ to it. If the number of excess days for 4 months is called $$TA$$, it can be calculated using the following equation. $$TA = ( 12 - NM ) ( SY / 12 - LM )$$ The adjustment of the excess days $$ed$$ is as follow. \begin{align} & \text{if ed < TA then } \\ & ed = ed + LM \\ &\text{end if} \end{align}
The threshold to determine whether the excess days exceeds $$LM$$ within the next 8 months, denoted by $$TW$$, is calculated using the following equation.

$$TW = LM - NM (SY / 12- LM)$$ $$TW$$ is a constant and its value is 22.2694539 days. If the number of excess days $$ed$$ is greater than or equal to the threshold $$TW$$, it is a year with the intercalary month (watat year).
\begin{align} & \text{if ed >=TW then } \\ &\text{ It is a year with the intercalary month} \\ &\text{end if} \end{align}
The results of this method are consistant with the past Myanmar calendar years in the third era. As an exception, 1344 ME had the intercalary month instead of 1345 ME.

Example: Check Myanmar year 1374 if it is a year with the intercalary month.

Solution:
Step 1: Find the number of excess days.
When we add 3739 to 1374 ME, Kali Yuga year is 5113. Multiplying the result with SY gives 1867568.0219845 days. The modulus of dividing it with LM is 24.1094389 days.
ed =( SY ( my + 3739 ) ) mod LM
=(365.2587565*(1374+3739)) mod 29.53058795
=24.1094385

Step 2: Adjust the excess days.
We don't need to do adjustment because it is greater than 3.630567 days.

Step 2: Check the excess days.
The number of excess days is greater than 22.2694539 days. Therefore it is a year with the intercalary month (watat year).

#### 4.2 Full Moon Days of Second Waso in the Third Era

In the Myanmar calendar, the full moon day of Second Waso in a watat year is the most consistent day. Because it is the full moon day just after the correction done by inserting the intercalary month and the intercalary day. Since the intercalary month and the intercalary day can be inserted only before Waso in a watat year, there is nothing we can do if there is any inconsistentcy in common years and other months. Many calendarists say that it is not possible to calculate future days in the Myanmar calendar because there is no fixed rule for the intercalary day. There is no fixed rule for it because, in the Myanmar calendar, it is very important for the full moon day of Second Waso to be accurate. In one of the guidelines of Myanmar Calendar Advisory Board, it is stated that the full moon day of Second Waso must have correct Tithi (a unit that is equal to $$\frac{LM}{30}$$ ) and proper zodiacal sign. Having such an accurate day to be referenced, it is possible to calculate the future days in the Myanmar calendar without having intercalary rules.

To get the full moon day of Second Waso in a watat year, we first need to calculate the starting time of the month Tagu by subtracting the number of excess days from the starting time of the year. The number of days between the starting time of Tagu and the full moon day of Second Waso is 4.5 $$LM$$. Then, the Julian Day Number of the full moon day of Second Waso is obtained by adding the starting time of Tagu with 4.5 $$LM$$ and taking the nearest integer. Since we prefer the full moon time nearer to midnight instead of noon, it is necessary to subtract 0.5 day (the number of day between the noon and the midnight) from the full moon time before taking the nearest integer. The constant which is used to adjust the full moon time of Second Waso is denoted by $$WO$$ and its value for the third era is therefore -0.5.
$$WO = - 0.5$$ If we denote the full moon day of Second Waso in a watat year with $$w$$, it can be calculated from the starting time of the year $$ja$$ and the number of excess days $$ed$$ as $$w = \lfloor ja - ed + 4.5 LM + WO \rceil$$ where round(x) = $$\lfloor x \rceil$$ is the operation that takes the nearest integer (rounding). Alternatively, by substituting $$ja$$ using the equation that we mentioned earlier, $$w$$ is obtained as
$$w = \lfloor SY . my + MO - ed + 4.5 LM + WO \rceil .$$ When we check the results of the above equation for all the past full moon days of Second Waso in the third era, all the full moon days are consistent except ME 1377 whose full moon day of Second Waso falls a day later.

Example: Find the full moon day of Second Waso for 1374 ME which has 24.1094385 excess days.

Solution:
Substituting the value of solar year, SY with 365.2587565 days, starting time of 0 ME with 1954168.0506 and WO with -0.5,
w = round( SY * my + MO - ed + 4.5 LM + WO )
= round( 365.2587565 * 1374 + 1954168.0506 - 24.1094385 + 4.5*29.53058795 - 0.5 )
= round(2456141.86)
= 2456142

The full moon day of Second Waso is obtained as Julian Day Number 2456142. Using Julian Date to Western Date Converter, it is found as 2012 CE, August 2.

The summary of the rule to determine the intercalary month and the full moon day of second Waso in the third era is as follow.

Intercalary month and the full moon day of second Waso in the third era
Description Equation
Find the number of excess days $$ed$$ for a given Myanmar year $$my$$.   $$ed =( SY ( my + 3739 ) ) \text{ mod } LM$$
where $$SY$$ = 365.2587565, $$my$$ = Myanmar year, $$LM$$ = 29.53058795, $$ed$$ = excess days.
If the number of excess days $$ed$$ is smaller than $$TA$$, adjust it by adding $$LM$$. If ed < 3.630567 then
ed = ed + 29.53058795
end if
If the adjusted excess days is greater than or equal to $$TW$$, it is a year with the intercalary month. If ed ≥ 22.2694539 then
watat = 1
else
watat = 0
end if
If it is a watat year, find the full moon day of second Waso $$w$$. $$w = \lfloor SY . my + MO - ed + 4.5 LM + WO \rceil$$
where $$w$$ = the full moon day of second Waso, $$MO$$ = 1954168.050623, $$WO$$ = -0.5.

#### 4.3 Intercalary Months and Full Moon Days of Second Waso in the Second Era

The Myanmar calendar system used in the second era is proposed by Nyaungkan Sayardaw who translated Surya Siddhanta to Myanmar. The period of the second era is about 100 years. Surya Siddhanta reached to Myanmar in 1203 ME, but the Surya Siddhantic system by Nyaungkan Sayardaw was started using only in 1217 ME due to the dominance of the old System that uses 19 years metonic cycle [Kyaing, 1964], p-160.
If the number of excess days becomes the full lunar month (LM) within the first 4 months of a year, it is the year with the intercalary month. If the excess days becomes the full lunar month only within the last 8 months, the following year is the year with the intercalary month. The number of months that defines the time to determine the intercalary month , denoted by NM, for the second era is $$NM = 4.$$ Therefore, the rule for the second era is same as the rule for the third era except NM is 4 months instead of 8 months. The equations for the third era can be applied for the second era by substituting NM with 4 months. The years with the intercalary months in the second era are consistent with the calculated results except 1263 ME is a year with the intercalary month instead of 1264 ME.
The full moon days of Second Waso for the second era can be calculated using the same method which is used for the third era. The only difference is that the constant WO for the second era is
$$WO = - 1 .$$
When we check the results of the calculation for all the past full moon days of Second Waso in the second era, all the full moon days are consistent except that it was a day earlier than calculation result in 1261 ME and a day later in 1234 ME.
The summary of the rule to determine the intercalary month and the full moon day of second Waso in the second era is as follow.

Intercalary month and the full moon day of second Waso in the second era
Description Equation
Find the number of excess days $$ed$$ for a given Myanmar year $$my$$.   $$ed =( SY ( my + 3739 ) ) \text{ mod } LM$$
where $$SY$$ = 365.2587565, $$my$$ = Myanmar year, $$LM$$ = 29.53058795, $$ed$$ = excess days.
If the number of excess days $$ed$$ is smaller than $$TA$$, adjust it by adding $$LM$$. If ed < 7.261134 then
ed = ed + 29.53058795
end if
If the adjusted excess days is greater than or equal to $$TW$$, it is a year with the intercalary month. If ed ≥ 25.900020 then
watat = 1
else
watat = 0
end if
If it is a watat year, find the full moon day of second Waso $$w$$. $$w = \lfloor SY . my + MO - ed + 4.5 LM + WO \rceil$$
where $$w$$ = the full moon day of second Waso, $$MO$$ = 1954168.050623, $$WO$$ = -1.

#### 4.4 Intercalary Months and Full Moon Days of Second Waso in the First Era

The first era is the era of Inwa dynasty that used the19 years metonic cycle. A Myanmar year is divided by 19. If the remainder is equal to 2, 5, 7, 10, 13, 15 or 18, it is a year with the intercalary month. As an exception, 1201 ME was the year with the intercalary month instead of 1202 ME [Kyaing, 1964], p-182. Although the metonic cycle have not used since 1207 ME (1855 CE), a recently published paper by Chatterjee [Chatterjee, 1998] and a few web pages wrongly state that the Myanmar calendar uses the metonic cycle.

There were three calculation methods in the first era [Irwin, 1909] p-15. These methods are listed in the following table.

The Myanmar Calendar Calculation Methods in the First Era
Methods Description
Makaranta calculations From 0 ME to 797 ME. Poppasaw's epoch.
Second Makaranta calculations From 798 ME to 1099 ME. The epoch of Mohnyin, King of Ava.
Thandeikta calculations From 1100 ME to 1216 ME.

The full moon days of Second Waso for the first era can be calculated using the same method which is used for the third era with the following exception. The number of months that defines the time to determine the intercalary month for the first era is $$NM = -1.$$ The constant $$WO$$ for the years earlier than ME 1100 is
$$WO=-1.1$$
and its value for the years on and after ME 1100 and before the second era is
$$WO=-0.85.$$
The calculated full moon days of the first era using the above method has some exceptions as usual when comparing with some existing records [Toe, 1999]. These exceptions can be rectified by using a table look up method.
The summary of the rule to determine the intercalary month and the full moon day of second Waso in the first era is as follow.

Intercalary month and the full moon day of second Waso in the first era
Description Equation
Find the number of excess days $$ed$$ for a given Myanmar year $$my$$.   $$ed =( SY ( my + 3739 ) ) \text{ mod } LM$$
where $$SY$$ = 365.2587565, $$my$$ = Myanmar year, $$LM$$ = 29.53058795, $$ed$$ = excess days.
If the number of excess days $$ed$$ is smaller than $$TA$$, adjust it by adding $$LM$$. If ed < 11.799343 then
ed = ed + 29.53058795
end if
Myanmar year is divided by 19. If the remainder is equal to 2, 5, 7, 10, 13, 15 or 18, it is a year with the intercalary month. $$watat=(my \times 7+2) \text{ mod } 19$$
If watat < 0 then
watat = watat + 19
end if
$$watat=\lfloor \frac{watat}{12} \rfloor$$
If it is a watat year, find the full moon day of second Waso $$w$$. $$w = \lfloor SY . my + MO - ed + 4.5 LM + WO \rceil$$
where $$w$$ = the full moon day of second Waso, $$MO$$ = 1954168.050623, $$WO$$ = -1.1 for my < 1100 ME and -0.85 for my ≥ 1100 ME.

Javascript code for checking the intercalary month and the full moon day of second Waso is shown below.
  //Era definition
var g_eras=[
//-------------------------------------------------------------------------
//The first era (the era of Myanmar kings: ME1216 and before)
//Makaranta system 1 (ME 0 - 797)
{
"eid":1.1,//era id
"begin":-999,//beginning Myanmar year
"end":797,//ending Myanmar year
"WO":-1.1,// watat offset to compensate
"NM":-1,//number of months to find excess days
"fme":[[205,1],[246,1],[471,1],[572,-1],[651,1],[653,2],[656,1],[672,1],
[729,1], [767,-1]],//exceptions for full moon days
"wte":[]//exceptions for watat years
},
//Makaranta system 2 (ME 798 - 1099)
{
"eid":1.2,//era id
"begin":798,//beginning Myanmar year
"end":1099,//ending Myanmar year
"WO":-1.1,// watat offset to compensate
"NM":-1,//number of months to find excess days
"fme":[[813,-1],[849,-1],[851,-1],[854,-1],[927,-1],[933,-1],[936,-1],
[938,-1],[949,-1],[952,-1],[963,-1],[968,-1],[1039,-1]],
//exceptions for full moon days
"wte":[]//exceptions for watat years
},
//Thandeikta (ME 1100 - 1216)
{
"eid":1.3,//era id
"begin":1100,//beginning Myanmar year
"end":1216,//ending Myanmar year
"WO":-0.85,// watat offset to compensate
"NM":-1,//number of months to find excess days
"fme":[[1120,1],[1126,-1],[1150,1],[1172,-1],[1207,1]],//exceptions for full moon days
"wte":[[1201,1],[1202,0]]//exceptions for watat years
},
//---------------------------------------------------------
//The second era (the era under British colony: 1217 ME - 1311 ME)
{
"eid":2,//era id
"begin":1217,//beginning Myanmar year
"end":1311,//ending Myanmar year
"WO":-1,// watat offset to compensate
"NM":4,//number of months to find excess days
"fme":[[1234,1],[1261,-1]],//exceptions for full moon days
"wte":[[1263,1],[1264,0]]//exceptions for watat years
},
//---------------------------------------------------------
//The third era (the era after Independence 1312 ME and after)
{
"eid":3,//era id
"begin":1312,//beginning Myanmar year
"end":9999,//ending Myanmar year
"WO":-0.5,// watat offset to compensate
"NM":8,//number of months to find excess days
"fme":[[1377,1]],//exceptions for full moon days
"wte":[[1344,1],[1345,0]]//exceptions for watat years
}
];
//-------------------------------------------------------------------------
//Check watat (intercalary month)
//input: (my -myanmar year)
//output:  ( watat - intercalary month [1=watat, 0=common]
//  fm - full moon day of 2nd Waso in jdn [valid for watat years only])
//dependency: chk_exception(my,fm,watat,ei)
function chk_watat(my) {
for(var i=g_eras.length-1;i > 0;i--) if(my >= g_eras[i].begin) break;//get data for respective era
var era=g_eras[i]; var NM=era.NM,WO=era.WO;
var SY=1577917828/4320000; //solar year (365.2587565)
var LM=1577917828/53433336; //lunar month (29.53058795)
var MO=1954168.050623; //beginning of 0 ME

var ed=(SY*(my+3739))%LM; // excess day
if(ed < TA) ed+=LM;//adjust excess days
var fm=Math.round(SY*my+MO-ed+4.5*LM+WO);//full moon day of 2nd Waso
var TW=0,watat=0;//find watat
if (era.eid >= 2) {//if 2nd era or later find watat based on excess days
TW=LM-(SY/12-LM)*NM;
if(ed >= TW) watat=1;
}
else {//if 1st era,find watat by 19 years metonic cycle
//Myanmar year is divided by 19 and there is intercalary month
//if the remainder is 2,5,7,10,13,15,18
//https://github.com/kanasimi/CeJS/blob/master/data/date/calendar.js#L2330
watat=(my*7+2)%19; if (watat < 0) watat+=19;
watat=Math.floor(watat/12);
}
i=bSearch(my,era.wte); if (i >= 0) watat=era.wte[i];//correct watat exceptions
if(watat) {i=bSearch(my,era.fme); if(i >= 0) fm+=era.fme[i]; }//correct full moon day exceptions
return {fm:fm,watat:watat};
}


### 5. Intercalary Day

A Myanmar year with the intercalary month is called a watat year. Only watat years can have the intercalary day. A watat year without the intercalary day is called a little watat year and First Waso which has 30 days is inserted before Waso. A watat year with the intercalary day is called a big watat year and 31 days (30 days in First Waso and 1 day at the end of Nayon) are inserted before Waso. Therefore, it is not necessary to check whether a common year has the intercalary day. If a year is a watat year, the full moon day of Second Waso is calculated to determine the intercalary day. As the first step, the full moon day of Second Waso in the nearest watat year before is searched. The difference of Julian Day Numbers of these two full moon days is then divided by 354 which is the number of days in a common year. If the remainder is 30 days, only First Waso should be inserted and it is a little watat year. If the remainder is 31 days, both First Waso and the intercalary day in Nayon should be inserted and it is a big watat year.

Example: Check 1374 ME whether it is a little or big watat year. Its excess days is 24.1094385 days and its full moon day of Second Waso is Julian Day Number 2456142.

Solution:

Step 1: Find the nearest watat year before 1374 ME.

When 1373 ME is checked, its excess days is 13.2177375 days. Since it is not less than TA = 3.630567 days, adjustment of the excess days is not needed. It is less than TW = 22.2694539 days and it is a common year.
Therefore, the earlier 1372 ME is checked again. Its excess days is 2.3260363 days. Since it is less than TA = 3.630567 days, it is adjusted by adding LM = 29.53058795 days resulting 31.8566243 days. It is greater than TW = 22.2694539 days and it is a watat year.

Step 2: Find the difference between the two full moon days.

The full moon day of Second Waso in 1372 ME is round( SY . 1372 + MO - 31.8566243 + 4.5 LM + WO ) = 2455404. The difference is 2456142-2455404 = 738 days. After divided by 354, the remainder is 30 days. Therefore, 1374 ME is a little watat year.

### 6. The first day of Tagu

If the first day of Tagu in the earlier part of a year and the type of the year (common, little watat, big watat) are known, the rest days in the year can be determined. Kyaing presented a method that subtracts the excess days from the starting time of the year to get the first of Tagu [Kyaing, 1964]. But after realization and calculations, we found that his method often gives wrong results. The reason is that the mechanism for the Myanmar calendar to correct the accumulated day error works only at watat years. Even for a watat year, adding the intercalary month and the intercalary day is carried out only before Waso. If there is any inconsistency in other months and other common years, there is no way to correct. That is why, the full moon day of Second Waso is the most consistent day in the Myanmar calendar. If we want to find the first day of Tagu, we should find it by referencing the full moon day of Second Waso in the nearest watat year before it (denoted by w1). The year difference between that year and the nearest watat year is denoted by yd. Then, the first day of Tagu (denoted by tg1) can be calculated as follow.
$$tg1 = w1 + 354 . yd - 102$$

Example: Find the first day of Tagu for 1374 ME which is in the earlier part of the year. The nearest watat year before is 1372 and its full moon day of Second Waso is 2455404.

Solution:
The number of common years between 1372 and 1374, yd = 2
tg1 =w + 354 . yd - 102
= 2455404 + 354 * 2 - 102
= 2456010

Using Julian Date to Western Date Converter, it is found to be 2012 CE, March 23.

Javascript code for checking the intercalary day and calculating the first day of Tagu is shown below.
  //Check Myanmar Year
//input: (my -myanmar year)
//output:  (myt :year type [0=common, 1=little watat, 2=big watat],
//tg1 : the 1st day of Tagu as Julian Day Number
//fm : full moon day of [2nd] Waso as Julain Day Number)
//werr: watat error
//dependency: chk_watat(my)
function chk_my(my) {
var yd=0,y1,nd=0,werr=0,fm=0;
var y2=chk_watat(my); var myt=y2.watat;
do{ yd++; y1=chk_watat(my-yd);}while(y1.watat==0 && yd < 3);
if(myt) { nd=(y2.fm-y1.fm)%354; myt=Math.floor(nd/31)+1;
fm=y2.fm; if(nd!=30 && nd!=31) {werr=1;} }
else fm=y1.fm+354*yd;
var tg1=y1.fm+354*yd-102;
return {myt:myt,tg1:tg1,fm:fm,werr:werr};
}


### 7. Month and Day

If you know the first day of Tagu in the earlier part of a Myanmar year, finding month and day is trivial. To get the corresponding Myanmar month and day of a Julian Day Number(jdn), the day difference (dd) between the first day of Tagu (tg1) in the earlier part of the year and the day that you want to find (jdn) is calculated first.
$$dd = jdn - tg1 + 1$$

#### 7.1 Month

Although the first day of January is the new year's day in the Gregorian calendar, the first day of Tagu is not the new year's day in the Myanmar calendar. In the Myanmar calendar, the new year's day is the day after the atat day. The earlier part of Tagu (or) Kason before the new year's day is in the old year and the later part of Tagu (or) Kason after the new year's day is in the new year.
The new year's day in the Myanmar calendar does not have to fall on the first day of Tagu. in fact, it almost never does fall on the first waxing of Tagu. Tagu is always divided into two parts Hnaung Tagu (Late Tagu), before the New Year's Day and Oo Tagu (Early Tagu) on and after the new year's day. In some years, the new year falls in Kason and both Hnaung Tagu and Hnaung Kason exist. Therefore, just saying Tagu of 1373 ME is not complete as Oo Tagu of 1373 corresponds to 2011 CE while Hnaung Tagu of 1373 corresponds to 2012 CE.
The totol number of days in a common year, little watat year and big watat year is 354, 384 and 385 respectively. If the variable 'c' is 1 for a common year and 0 for a year with the intercalary month, and the variable 'b' (big watat) is 1 for a year with intercalary day and 0 for a year with no intercalary day, the length of a Myanmar year (myl) can be calculated as follow.
$$myl = 354 + 30 ( 1 - c ) + b$$
If the total number of days that has expired since the first day of Oo Tagu (dd) is greater than the lenght of the year, it is Hnaung Tagu or Hnaung Kason and the number of days, dd, should be adjusted. The type of a Myanmar month (Hnaung or Oo) is denoted by mmt and it is obtained by using the following equation.
$$mmt = \lfloor \frac{dd-1}{myl} \rfloor$$
The value of mmt is 0 for Oo and 1 for Hnaung. If the month type is Hnaung, the number of days, dd, is adjusted as follow.
$$dd = dd - mmt \times myl$$
Finding the month from the total number of days, dd, is trivial. For example, if dd is 62 days, we can minus 29 days for Tagu and 30 days for Kason that left only 3 days. Therefore, we easily say it is the third day of Nayon. To achieve better efficiency for the computer program, that repetitive subtracting procedure is replaced by deriving the equations.
The Myanmar month number can be calculated by using 'b' (big watat) and 'c' (common year) as follow. After finding the Myanmar month, by subtracting total number of days for all the earlier months from dd, the Myanmar day 'md' can be obtained.
$$a= \lfloor \frac{dd+423}{512} \rfloor$$ $$mm= \lfloor \frac{ dd - a . b + 30 . a . c + 29.26 }{29.544} \rfloor$$ $$e= \lfloor \frac{mm+12}{16} \rfloor$$ $$f= \lfloor \frac{mm+11}{16} \rfloor$$ $$md = dd - \lfloor 29.544 \times mm - 29.26 \rfloor - b . e + 30 . c . f$$ $$mm = mm + 3f - 4e$$ where the resulting 'mm' is the Myanmar month.
The equation to find the length of a month is also described below.
$$mml = 30 - mm \text{ mod } 2$$
If it is Nayon of a big watat year, the intercalary day is added.
\begin{align} & \text{if mm==3 then} \\ & mml = mml + bw \\ & \text{end if} \end{align}

#### 7.2 Day

The days of the month are counted in two halves, waxing and waning. The 15th day of a month is the full moon day. The new moon day is the last day of the month (14th or 15th waning). The fortnight day (waxing or waning day) is denoted by 'fd'. The phase of the moon is denoted by 'mp' where the waxing, full moon, waning and new moon are represented by 0, 1, 2 and 3 respectively. The following equations are used to calculate mp and fortnight day, fd.
$$fd = md - 15 . \lfloor \frac{md}{16} \rfloor$$ $$mp = \lfloor \frac{md + 1}{16} \rfloor + \lfloor \frac{md}{16} \rfloor + \lfloor \frac{md}{mml} \rfloor$$

#### 7.3 Weekdays

A week in the Myanmar calendar has 7 weekdays. Each weekday is assigned with a number, a sign, a direction and a planet as shown in the following table [Wikipedia].

Weekdays
English Myanmar Number Sign Direction Planet
Sunday Taninganwe 1 Garuda Northeast Sun
Monday Taninla 2 Tiger East Moon
Tuesday Inga 3 Lion Southeast Mars
Wednesday Buddahu 4 Elephant SouthMercury
Thursday Kyathabade 5 Rat West Jupiter
Friday Thaukkya 6 Guinea pig North Venus
Saturday Sanay 0 Naga Southwest Saturn

The weekday number (wd) for a given Julian day number (jdn) is calculated as follow.
$$wd = (jdn+2) \text{ mod } 7$$

### 8. JDN to Myanmar Date Conversion

The summery of our proposed method to convert Gregorian date to Myanmar date is as follows.

1. Find the Julian day number for the given Gregorian date.
2. Find the corresponding Myanmar year.
3. Check whether the resulting Myanmar year is a watat year.
4. Find the nearest watat year and its Second Waso full moon day before that year.
5. If that year is a watat year, check whether it is a little watat or big watat.
6. Find the first day of Tagu in the early part of that year.
7. Using the day count, check the month type. Then find the month and the day.

Example: Find the corresponding Myanmar date for 2012 CE, May 23.

Solution:

1. The Julian day number for the given date is 2456071. If you don't want to calculate, the Julian Day Converter can be found at the following link.
Western Date to Julian Date Converter

2. The corresponding Myanmar year is floor((2456071-1954168.5506)/365.2587565) = 1374 ME.

3. When checking that year, it has 24.1 excess days. Therefore, it is a watat year.

4. The nearest watat year before that year is 1372 ME and its Second Waso full moon day is 2455404.

5. The Second Waso full moon days for 1374 ME and 1372 ME are 2456142 and 2455404 respectively. Their difference is 738 days. When dividing with 354, the remainder is 30. Therefore, 1374 ME is a little watat year.

6. The first day of Tagu is 2455404+354*2-102= 2456010.

7. The number of days from the first day of Tagu is 2456071+1-2456010 = 62. Since it is less then the length of a little watat year, 384, it is not adjusted. Therefore, its month type is not 'Hnaung'. Subtracting 29 days for Tagu and 30 days for Kason leaves 3 days. Then, we know, it is Nayon waxing 3.

Using the javascript functions that we mentioned before, the code for calculating Myanmar date is shown below.
  //Julian date to Myanmar date
//input: (jd -julian date)
//output:  (my : year,
//myt :year type [0=common, 1=little watat, 2=big watat],
//myl: year length [354, 384, or 385 days],
//mm: month [Tagu=1, Kason=2, Nayon=3, 1st Waso=0, (2nd) Waso=4, Wagaung=5, Tawthalin=6,
//mmt: month type [1=hnaung, 0= Oo],
//mml: month length [29 or 30 days],
//md: month day [1 to 30],
//fd: fortnight day [1 to 15],
//mp :moon phase [0=waxing, 1=full moon, 2=waning, 3=new moon],
//wd: week day [0=sat, 1=sun, ..., 6=fri] )
//dependency: chk_my(my)
function j2m(jd) {
var SY=1577917828/4320000; //solar year (365.2587565)
var MO=1954168.050623; //beginning of 0 ME
var jdn,my,yo,dd,myl,mmt,a,b,c,e,f,mm,md,mml,mp,fd,wd;
jdn=Math.round(jd);//convert jd to jdn
my=Math.floor((jdn-0.5-MO)/SY);//Myanmar year
yo=chk_my(my);//check year
dd=jdn-yo.tg1+1;//day count
b=Math.floor(yo.myt/2); c=Math.floor(1/(yo.myt+1)); //big wa and common yr
myl=354+(1-c)*30+b;//year length
mmt=Math.floor((dd-1)/myl);//month type: Hnaung =1 or Oo = 0
dd-=mmt*myl; a=Math.floor((dd+423)/512); //adjust day count and threshold
mm=Math.floor((dd-b*a+c*a*30+29.26)/29.544);//month
e=Math.floor((mm+12)/16); f=Math.floor((mm+11)/16);
md=dd-Math.floor(29.544*mm-29.26)-b*e+c*f*30;//day
mm+=f*3-e*4; mml=30-mm%2;//adjust month and month length
if(mm==3) mml+=b;//adjust if Nayon in big watat
mp=Math.floor((md+1)/16)+Math.floor(md/16)+Math.floor(md/mml);
fd=md-15*Math.floor(md/16);//waxing or waning day
wd=(jdn+2)%7;//week day
return {my:my,myt:yo.myt,myl:myl,mm:mm,mmt:mmt,mml:mml,md:md,
mp:mp,fd:fd,wd:wd};
}


### 9. Myanmar Date to JDN Conversion

It is easier to find Julian day number from a Myanmar date. Myanmar year is given and we can use the method that has been mention before to get the Julian day number for the first day of Tagu. Myanmar month is also given and we can get the total number of days in the previous months. Then add the day number reduced by 1 to these days to get Julian day number for that Myanmar day. The resulting Julian day number can be easily converted to the Gregorian day using the method which was mentioned earlier. The day of the Myanmar month 'md' can be obtained from moon phase 'mp' and fortnight day 'fd' as follows.

$$m1 = ms \text{ mod } 2$$ $$m2 = \lfloor \frac{ms}{2} \rfloor$$ $$md = m1 . ( 15 + m2 . ( mml - 15 ) ) + ( 1 - m1 ) . ( d + 15 . m2)$$
The total number of days 'dd' can be calculated as follow.
$$mm = mm + 4 - 4 . \lfloor \frac{mm+15}{16} \rfloor + \lfloor \frac{mm+12}{16} \rfloor$$ $$dd = md + \lfloor 29.544 \times mm - 29.26 \rfloor - 30 c . \lfloor \frac{mm+11}{16} + b . \lfloor \frac{mm+12}{16}\rfloor$$
The total number of days is then adjusted for Myanmar month type 'mmt' by using Myanmar year length 'myl' as follow. $$myl = 354 + 30 ( 1 - c ) + b$$ $$dd = dd + mmt . myl$$
After that, the Julian day number is obtained from the first day of Tagu and the total number of days as follow.
$$jdn = dd + tg1 - 1$$
The summery of conversion from Myanmar date to Gregorian date is as follows.

1. Check whether the given Myanmar year is a watat year.
2. Find the nearest watat year and its Second Waso full moon day before that year.
3. If that year is a watat year, check whether it is a little watat or big watat.
4. Find the first day of Tagu in the early part of that year.
5. Using the month type, the month and the day, the total number of days is calculated. From the first day of Tagu and the total number of days, the Julian day number of the given Myanmar date is obtained.

Example: As an prove to the previous example, show that 1374 ME, Nayon waxing 3 is 2012 CE, May 23.

Solution:

1. When checking the year 1374 ME, it has 24.1 excess days. Therefore, it is a watat year.

2. The nearest watat year before that year is 1372 ME and its Second Waso full moon day is 2455404.

3. The Second Waso full moon days for 1374 ME and 1372 ME are 2456142 and 2455404 respectively. Their difference is 738 days. When dividing with 354, the remainder is 30. Therefore, 1374 ME is a little watat year.

4. The first day of Tagu is 2455404+354*2-102= 2456010.

5. Since the month type is not 'Hnaung', the length of the little watat year 1374 ME is not necessary to add as the adjustment. Adding 29 days for Tagu, 30 days for Kason, and 3 days for the given month Nayon gives 62 days. Adding the first day of Tagu results 2456010+62-1= 2456071. The Julian day number 2456071 corresponds to Gregorian date 2012 CE, May 23. A converter can be found at the following link.
Julian Date to Western Date Converter

The javascript code for converting Myanmar date to Gregorian date is shown below.
  //Myanmar date to Julian date
//input:  (my : year,
//mm: month [Tagu=1, Kason=2, Nayon=3, 1st Waso=0, (2nd) Waso=4, Wagaung=5, Tawthalin=6,
//mmt: month type [1=hnaung, 0=Oo],
//mp :moon phase [0=waxing, 1=full moon, 2=waning, 3=new moon],
//fd: fortnight day [1 to 15])
//output: (jd -julian day number)
//dependency: chk_my(my)
function m2j(my,mm,mmt,mp,fd) {
var b,c,mml,m1,m2,md,dd;
yo=chk_my(my);//check year
b=Math.floor(yo.myt/2); c=(yo.myt==0); //if big watat and common year
mml=30-mm%2;//month length
if (mm==3) mml+=b;//adjust if Nayon in big watat
m1=mp%2; m2=Math.floor(mp/2); md=m1*(15+m2*(mml-15))+(1-m1)*(fd+15*m2);
dd=md+Math.floor(29.544*mm-29.26)-c*Math.floor((mm+11)/16)*30
+b*Math.floor((mm+12)/16);
myl=354+(1-c)*30+b;//year length
return dd+yo.tg1-1;
}


### 10. Discussion

The calculated values of full moon time of Second Waso for all the watat years from 1988 CE to 2034 CE using the proposed method are compared against the corresponding full moon times found at timeanddate.com in the following table. The civil full moon days in the third column are obtained by taking 12 hours in advance from the calculated values using the current method i.e. taking the previous day if the full moon time is before 12 noon. It can be interpreted as taking the day that has the nearest midnight to the calculated full moon time.

Full moon time of Second Waso for watat years from 1350 ME to 1396 ME (Myanmar Standard Time).
Myanmar
Year
Full moon time by
the current method
Civil full
moon day
Full moon time by
timeanddate.com
Hour
difference
1350 1988-Jul-29 06:37 1988-Jul-281988-Jul-29 09:55-3
1353 1991-Jul-26 21:47 1991-Jul-261991-Jul-27 00:54-3
1355 1993-Aug-03 04:08 1993-Aug-021993-Aug-02 18:409
1358 1996-Jul-30 19:18 1996-Jul-301996-Jul-30 17:052
1361 1999-Jul-28 10:27 1999-Jul-271999-Jul-28 17:55-7
1363 2001-Aug-04 16:48 2001-Aug-042001-Aug-04 12:264
1366 2004-Aug-01 07:58 2004-Jul-312004-Aug-01 00:357
1369 2007-Jul-29 23:08 2007-Jul-292007-Jul-30 07:18-8
1372 2010-Jul-26 14:18 2010-Jul-262010-Jul-26 08:076
1374 2012-Aug-02 20:39 2012-Aug-022012-Aug-02 09:5811
1377 2015-Jul-31 11:48 2015-Jul-302015-Jul-31 17:13-5
1380 2018-Jul-28 02:58 2018-Jul-272018-Jul-28 02:510
1382 2020-Aug-04 09:19 2020-Aug-032020-Aug-03 22:2911
1385 2023-Aug-02 00:29 2023-Aug-012023-Aug-02 01:02-1
1388 2026-Jul-29 15:39 2026-Jul-292026-Jul-29 21:06-5
1391 2029-Jul-26 06:49 2029-Jul-252029-Jul-25 20:0611
1393 2031-Aug-03 13:10 2031-Aug-032031-Aug-03 08:155
1396 2034-Jul-31 04:19 2034-Jul-302034-Jul-31 12:25-8
Average difference 1.4

Some calendarists say that the Myanmar calendar should be changed because the accumulated day error is corrected only in watat year. From the author's point of view, it is not necessary to change the Myanmar calendar. In the Gregorian calendar, the day error is corrected four years a time. In the Myanmar calendar, the day error is corrected every two or three years while inserting intercalary month. Therefore, we think, it is acceptable. There are already simple rules in the Myanmar calendar such as adding the intercalary month before Waso and adding the intercalary day in Nayon. The current accuracy of the calendar as a civil calendar is accurate enough.

On the otherhand, it would be better if the Myanmar Calendar Advisory Board can announce precise definitions about the controversial issues. In the Myanmar calendar, it is clearly defined that there are only three types of years, common, little watat and big watat. The number of days in their corresponding months is also defined. But there is no precisely-defined number for adding intercalary month and intercalary day.

Another problem is the precision of number type. For example, let us consider a case where the exact time for a new moon which takes effect intercalary day is around mid-night. For a person who only uses one decimal place, his calculation result for intercalary day can be 0.5. Therefore, he might insert the intercalary day for that year. For another person who uses two decimal places, the result of his calculation might be 0.49. And he might duly assume that there is no intercalary day for that same year. As a result, there is usually a dispute if such a situation occured. In our opinion, the problem will be relieved if we all use a standard format like double-precision floating-point format (IEEE 754 standard).

### 11. Conclusion

The topic about the Myanmar calendar is wide and it is impossible to cover everything in such a short article. We only present a method for calculation. The main objectives of this article are the algorithm, calculation and its implementation as a computer program. The values of the constants are not discussed although we have mentioned and estimated their values.
Nevertheless, there is now a clear and easy method for the Myanmar calendar calculation. We hope that it could be also helpful in defining precise rules and constants.

### Acknowledgement

I would like to express my thanks to Aung Soe Moe and Tun Tun Aye for their help in finding information about the Myanmar calendar. I also wish to show my appreciation to Ye Lin Kyaw and U Aung Thu for sharing their knowledge and sending the facts about the Myanmar calendar. I would like to express my deepest gratitude to Ko Aye Nyein for his presents, U Ohn Kyaing's book and Soe Moe Naing's 100 years calendar, and Ko Wunna Ko for the book, Tin Naing Toe's English-Myanmar Calendar.

### References

[Clancey, 1906] Clancey, J. C., "The Burmese calendar," The Observatory, Vol. 29, p. 54-59,1906. Available online.

[Chatterjee, 1998] SK Chatterjee, "Traditional Calendar of Myanmar (Burma)," Indian Journal of History of Science, 1998. Available online.

[Dershowitz, 2008] Nachum Dershowitz, Edward M. Reingold, "Calendrical Calculations," 3rd Edition, Cambridge University Press, 2008.

[Irwin, 1901] Irwin, A. M. B., "The Burmese Calendar," London: S. Low, Marston, 1901. Available online.

[Irwin, 1909] Irwin, A. M. B., "The Burmese & Arakanese calendars,"Rangoon : Printed at the Hanthawaddy printing works, 1909. Available online.

[Jefferys, 1998] Bill Jefferys, "Julian Day Calculations," http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html, 1998.

[Ko, 2009] Wunna Ko, "Myanmar Calendar Program," http://myanmarcalendar.sourceforge.net/, 2009.

[Kyaing, 1964] Ohn Kyaing, "Myanmar Patkadain Thutaythana Kyan," Sarpaybeitman, 1964.

[Myers, 2011] Paul Myers, "Julian Day Numbers," http://pmyers.pcug.org.au/General/JulianDates.htm, 2011.

[Nyein, 2012] Aye Nyein, "Myanmar Calendrical Calculation," http://shwenyein.blogspot.sg/2012/07/blog-post_1862.html, 2012.

[Nyein, 2014] Aye Nyein (Laymyathnar), "Myanmar Calendar," 1st Edition, Ywat Sein Press, Yangon, 2014.

[Toe, 1999] Tin Naing Toe, "Myanmar - English Calendar," Lin Set Sarpay, 1999.

[UTSA, 2011] The University of Texas at San Antonio, "Explanation of Julian Day Number Calculation," http://www.cs.utsa.edu/~cs1063/projects/Spring2011/Project1/jdn-explanation.html, 2011.

[Wikipedia] "Burmese Calendar," http://en.wikipedia.org/wiki/Burmese_calendar

Myanmar Astrological Calendar Days
Myanmar Calendar : mc1500
Myanmar Calendar : mc1500 Source Code on GitHub

1. Excellent article; thank you very much for making this info available. Are you located in Myanmar ?

2. Thank you. I am currently staying in Singapore.

3. hello... i want to ask a questions. if Myanmar birth year in 1350 (Myanmar Calendar), what is actually year his/her year of birth?

4. ME 1350 begins on CE 1988 April 16 and it ends on CE 1989 April 16.

5. Dear Yan Naing Aye,

First of all, congratulation for this concise article.

I want to implement this solution into my application but I am facing few problems that I would like to clarify with you.

1) Full moon day
Myanmar year -498 is a leap year, but when I compute its length (number of days) thanks to the full moon algorithm (see chapter 4.4), I got 354.
Is there a limitation in your algorithm?

2) Number of intercalary days
Wikipedia indicates that we should have not more than 11 days every big cycle of 57 years. I found one sequence with 12 days. Is that normal?

3) Number of intercalary months
There are not more by 7 additional Waso every 19 years as stated by Wikipedia again. Is this rule is also valid?

1. 