Muslims measure the passage of time using the Islamic (Hijrah) calendar. This calendar has twelve lunar months, the beginnings and endings of which are determined by the sighting of the crescent moon. Years are counted since the Hijrah, which is when the Prophet Muhammad migrated from Makkah to Madinah (approximately July 622 A.D.).
The Islamic calendar was first introduced by the close companion of the Prophet, Umar ibn Al-Khattab. During his leadership of the Muslim community, in approximately 638 A.D., he consulted with his advisors in order to come to a decision regarding the various dating systems used at that time. It was agreed that the most appropriate reference point for the Islamic calendar was the Hijrah, since it was an important turning point for the Muslim community. After the emigration to Madinah (formerly known as Yathrib), the Muslims were able to organize and establish the first real Muslim "community," with social, political, and economic independence. Life in Madinah allowed the Muslim community to mature and strengthen, and the people developed an entire society based on Islamic principles.
The Islamic calendar is the official calendar in many Muslim countries, especially Saudi Arabia. Other Muslim countries use the Gregorian calendar for civil purposes and only turn to the Islamic calendar for religious purposes.