section_path: Calculations/Worked example
section_name: Worked example
paragraph_text: Worked example
  
  Given the length of the year, the length of each month is fixed as described above, so the real problem in determining the calendar for a year is determining the number of days in the year. In the modern calendar, this is determined in the following manner.
  
  The day of Rosh Hashanah and the length of the year are determined by the time and the day of the week of the Tishrei molad, that is, the moment of the average conjunction. Given the Tishrei molad of a certain year, the length of the year is determined as follows:
  
  First, one must determine whether each year is an ordinary or leap year by its position in the 19-year Metonic cycle. Years 3, 6, 8, 11, 14, 17, and 19 are leap years.
  
  Secondly, one must determine the number of days between the starting Tishrei molad (TM1) and the Tishrei molad of the next year (TM2). For calendar descriptions in general the day begins at 6 pm, but for the purpose of determining Rosh Hashanah, a molad occurring on or after noon is treated as belonging to the next day (the first deḥiyyah). All months are calculated as 29d, 12h, 44m, 3 + 1 ⁄ 3 s long (MonLen). Therefore, in an ordinary year TM2 occurs 12 × MonLen days after TM1. This is usually 354 calendar days after TM1, but if TM1 is on or after 3:11:20 am and before noon, it will be 355 days. Similarly, in a leap year, TM2 occurs 13 × MonLen days after TM1. This is usually 384 days after TM1, but if TM1 is on or after noon and before 2:27:16 + 2 ⁄ 3 pm, TM2 will be only 383 days after TM1. In the same way, from TM2 one calculates TM3. Thus the four natural year lengths are 354, 355, 383, and 384 days.
  
  However, because of the holiday rules, Rosh Hashanah cannot fall on a Sunday, Wednesday, or Friday, so if TM2 is one of those days, Rosh Hashanah in year 2 is postponed by adding one day to year 1 (the second deḥiyyah). To compensate, one day is subtracted from year 2. It is to allow for these adjustments that the system allows 385-day years (long leap) and 353-day years (short ordinary) besides the four natural year lengths.
  
  But how can year 1 be lengthened if it is already a long ordinary year of 355 days or year 2 be shortened if it is a short leap year of 383 days? That is why the third and fourth deḥiyyah s are needed.
  
  If year 1 is already a long ordinary year of 355 days, there will be a problem if TM1 is on a Tuesday, as that means TM2 falls on a Sunday and will have to be postponed, creating a 356-day year. In this case, Rosh Hashanah in year 1 is postponed from Tuesday (the third deḥiyyah). As it cannot be postponed to Wednesday, it is postponed to Thursday, and year 1 ends up with 354 days.
  
  On the other hand, if year 2 is already a short year of 383 days, there will be a problem if TM2 is on a Wednesday. because Rosh Hashanah in year 2 will have to be postponed from Wednesday to Thursday and this will cause year 2 to be only 382 days long. In this case, year 2 is extended by one day by postponing Rosh Hashanah in year 3 from Monday to Tuesday (the fourth deḥiyyah), and year 2 will have 383 days.