It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Fast upon sighting the moon and celebrate Eid al-Fitr upon sighting the moon. If clouds come between you and the moon, then complete the count to thirty. However, sometimes the month is also of twenty-nine days."
Hadith Referenceمسند احمد / ومن مسند بني هاشم / 2335
Hadith Gradingحکم دارالسلام:صحيح، دون قوله: الشهر تسع وعشرون فصحيح لغيره، وسماك فى روايته عن عكرمة اضطراب