It is narrated from Sayyiduna Talq bin Ali (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "When you see it (the moon), fast, and when you see it, stop fasting; and if it is obscured from you, complete the count of thirty."
Hadith Referenceالمعجم الكبير للطبراني / باب الطاء / 8207