Iran uses a calendar of its own which is slightly more exact than the Gregorian calendar. The present Iranian calendar, also called the Jalali calendar, dates back to the eleventh century, when Jalal-ed-din Malek Shah Seljuq commissioned a panel of scientists in 1074-1079 AD to create a calendar more accurate than those in use at the time. Prominent among the scientists was Omar Khayyám, best known today for his poetry, especially The Rubaiyat.
The Iranian year begins on the day of the vernal equinox - the first day of spring. It consists of 12 months which have retained their old Persian names. They are: Farvardin, Ordibehesht, Xordad; Tir, Mordad, Shahrivar; Mehr, Aban, Azar; Dey, Bahman, and Esfand. The first six months are each 31 days, the next five 30 days, and the last 29 (except in leap years, when it is 30 days). They roughly correspond to the signs of the zodiac. The Iranian calendar coincides with the tropical year, which is 365.24219 days long, but because of the constraints of adjusting the beginning of the calendar to the beginning of the day (at midnight), on the average, the Iranian calendar runs short of the tropical year by 5h, 48m, 45.2s each year. In addition, in astronomical terms, the length of a year shortens by 0.00000615th of a day every century.
To compensate for these discrepancies, leap years are devised, mostly every four years. Four-year leap years add 0.25 day to each year in the period. That is more than the discrepancy with the tropical year and the shortening of the years which are less than a quarter of a day. To remedy this overcompensation, after every six or seven four-year leap years, the Iranian calendar provides for a five-year leap year, i.e., the leap year occurs after four normal years instead of three. To establish the frequency of the five-year leap years, the Jalali scientists took the period of 2820 years as the base for their calculations. At the beginning and the end of the 2820-year cycle the vernal equinox takes place exactly at the same time of the tropical year. They divided the cycle by 128 which is the period in which, with appropriate addition of five-year leap years, the Iranian calendar would coincides with the tropical year. They came up with 21 segments of 128 years and one odd segment of 132 years.
Over the centuries, astronomers have elaborated different methods to calculate the frequency of the leap years in the 128-year period. One formula for establishing whether an Iranian calendar year is normal or a leap year is to add 38 to the year, multiply the result by 31, and divide by 128. When the fractional part of the result is equal to or greater than 0.31, the year in question is a normal year. On the other hand, if it is less than 0.31, then the year is a leap year, except in the special case that two consecutive fractional parts are less than 0.31, in which case the first is a leap year and the second a normal year. The number 38 represents the years separating the beginning of the 2820-year cycle from Hejira - the year of Mohammed's flight from Mecca to Medina, corresponding to 621-622 AD, which the Jalali panel of scientists chose as the first year of the Iranian calendar. 31 is the number of leap years needed in a 128-year period to permit the Iranian calendar to coincide with the tropical year.
Nevertheless, the minute discrepancies and odd segments will not permit the Iranian calendar to remain in perpetual synchronization with the solar cycle. In 141,000 years, the Iranian calendar will deviate from the solar cycle by one day. That, however, is far less than the Gregorian calendar's deviation, which will be one day in 5025 years.