Sayyiduna Talq bin Ali (may Allah be pleased with him) narrates from the Prophet (peace and blessings be upon him) that he (peace and blessings be upon him) said: "Indeed Allah, the Mighty and Majestic, has made these new moons (a means of determining) times. So when you see it, fast, and when you see it, stop fasting (celebrate Eid); and if it is obscured from you (by clouds), complete thirty days." (These are the words of Luwayn; Yahya bin Ishaq said in his narration: "If it is obscured from you, complete the count.")
Hadith Referenceالمعجم الكبير للطبراني / باب الطاء / 8206