The Islamic calendar is purely lunar and consists of twelve alternating months of 30 and 29 days, with the final 29 day month extended to 30 days during leap years. Leap years follow a 30 year cycle and occur in years 1, 5, 7, 10, 13, 16, 18, 21, 24, 26, and 29. Days are considered to begin at sunset. The calendar begins on Friday, July 16th, 622 C.E. in the Julian calendar, Julian day 1948439.5, the day of Muhammad's flight from Mecca to Medina, with sunset on the preceding day reckoned as the first day of the first month of year 1 A.H.--"Anno Hegirę"--the Arabic word for "separate" or "go away". Weeks begin on Sunday, and the names for the days are just their numbers: Sunday is the first day and Saturday the seventh.Each cycle of 30 years thus contains 19 normal years of 354 days and 11 leap years of 355, so the average length of a year is therefore ((19 × 354) + (11 × 355)) / 30 = 354.365... days, with a mean length of month of 1/12 this figure, or 29.53055... days, which closely approximates the mean synodic month (time from new Moon to next new Moon) of 29.530588 days, with the calendar only slipping one day with respect to the Moon every 2525 years. Since the calendar is fixed to the Moon, not the solar year, the months shift with respect to the seasons, with each month beginning about 11 days earlier in each successive solar year.
The calendar presented here is the most commonly used civil calendar in the Islamic world; for religious purposes months are defined to start with the first observation of the crescent of the new Moon.
Adapted from Formilab's Calendar Converter.