Ibn ‘Umar reported God’s messenger as saying, “Do not fast till you see the new moon, and do not break your fast till you see it; but if the weather is cloudy calculate when it should appear.” In a version he said, “The month consists of twenty-nine days, but do not fast till you see it, and if the weather is cloudy wait till thirty days of the previous month have passed.”
(Bukhari and Muslim.)