The number of months in the sight of Allah is twelve (in a year)- so ordained by Him the day He created the heavens and the earth; of them four are sacred: that is the straight usage. So wrong not yourselves therein, and fight the Pagans all together as they fight you all together. But know that Allah is with those who restrain themselves.
There are two systems in use in our world today to keep track of the passage of the years: the lunar calendar, based on the cycle of the moon; and the solar calendar, which is based on the movement of the earth around the sun. Both of them are built on the principle of twelve months consisting of around thirty days each, though the solar calendar is less accurate and requires periodic adjustment (leap years etc). The early Muslims knew of both systems, and the medieval writer, Ibn al-‘Arabi, commented on the utility of both in these words: “The solar calendar is for the benefit of worldly matters, while the lunar calendar is for religious observances.” So while modern Muslims (and Jews) often regulate their religious festivals by the lunar cycle, they have generally made compromises with the solar calendar currently in ascendancy in this materialistically oriented world.
Emerick, Yahiya. The Meaning of the Holy Qur’an in Today’s English (p. 829). Unknown. Kindle Edition.