It is narrated from Sayyiduna Ali (may Allah be pleased with him) that he said: "A month is thirty days, and a month is (also) twenty-nine days."
According to the imams of hadith, the purpose of this statement is to make clear the legal status of the lunar month: in the Islamic calendar the length of a lunar month is sometimes a full thirty days, and sometimes, on the basis of sighting the crescent, it consists of twenty-nine days.
Hadith Referenceالمطالب العالية بزوائد المسانيد الثمانية / كتاب الصيام / 992
Hadith Gradingمحدثین:إسناده صحيح، موقوف
Hadith Takhrij«حکم الحدیث المطالب العالیہ محققاً تنسیق د. سعد بن ناصر بن عبد العزيز الشَّثري- مکتبہ شاملہ :صحيح موقوف. » «أخرجه مصنف ابن أبي شيبة برقم: 9702»