Browse Prior Art Database

Algorithmic Generation of Islamic Hijri Calendar

IP.com Disclosure Number: IPCOM000118376D
Original Publication Date: 1997-Jan-01
Included in the Prior Art Database: 2005-Apr-01
Document File: 6 page(s) / 181K

Publishing Venue

IBM

Related People

El-Rafei, S: AUTHOR

Abstract

The Islamic Hijri calendar is a pure lunar calendar. Months are counted from conjunction to conjunction. A month starts on the first day after conjunction if the new moon is visible after sunset. Since a synodic month does not contain a fixed number of days (being 29.5305941 days approximately), the Islamic calendar does not have a fixed cycle. Thus, the Islamic Hijri calendar is not based on number base arithmetic, like other calendars. This raises considerable difficulties in the use of the Islamic Hijri calendar in computers.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 32% of the total text.

Algorithmic Generation of Islamic Hijri Calendar

      The Islamic Hijri calendar is a pure lunar calendar.  Months
are counted from conjunction to conjunction.  A month starts on the
first day after conjunction if the new moon is visible after sunset.
Since a synodic month does not contain a fixed number of days (being
29.5305941 days approximately), the Islamic calendar does not have a
fixed cycle.  Thus, the Islamic Hijri calendar is not based on number
base arithmetic, like other calendars.  This raises considerable
difficulties in the use of the Islamic Hijri calendar in computers.

      Algorithms for generating Hijri dates from Julian Day Number,
and vice versa, are described herein.  The algorithms described are
self contained (i.e., they do not rely on storing astronomical
predictions), and they cover the whole era (i.e., they are not
restricted to a specific  period).  Furthermore, the results of the
algorithms coincide with the  official Saudi Arabian calendar, also
known as Um Al-Qura, permitting computer implementation in most
business applications.

      The basic idea of Hijri calendar computation is based on
determining a reference point, as a Julian Day Number, that is
immediately preceding a lunar conjunction (and hence, containing a
whole number of months since epoch), and determining the number of
whole months up to and including this point; this point is called
month origin.  To determine the broken down date from a given Julian
Day Number, the number of elapsed months is easily converted to years
and months, and the offset since month origin is easily converted to
day of month.  Conversely, to determine the Julian Day Number from a
broken down date, the month origin of the given month is determined,
then the Julian Day Number is simply the sum of the Julian Day number
of the month origin and the given day of month.

      To determine the Julian Day Number of the month origin, lunar
conjunction is sought from an approximate Julian Day Number using a
mathematical function that predicts the Moon "age"; this function
returns an angular quantity in degrees, representing the Moon age at
midnight of a designated day, a positive value for waxing Moon, and a
negative value for waning Moon.  This latter function is referred to
in the algorithms as MoonPosition(), and it is a function of Julian
Day Number.

The following parameters generically defines the Hijri calendar:
  Epoch:  AD 0622-07-15 T 00:00:00 (Julian Day Number 1948438.5)
  Year length (max):  355 days (leap year)
  Year length (min):  354 days (common year)
  Months per year:  12
  Month length (average):  29.530585 days
  Month length (max):  30 days
  Month length (min):  29 days

Hijri Date to Julian Day Number
  1.  Set Era, Year, Month, Day, Hour, Min, and Sec to the
       values of era, year number, month number, day of month,
       hour, minute and second respectively.
  2.  If not a valid date
   ...