The Messenger of Allah ﷺ said, "When you see the crescent moon, begin fasting, and when you see it again, end your fasting. If it is obscured from your view, then complete thirty days of fasting."
أن رسول الله ﷺ قال: إذا رأيتم الهلال فصوموا، وإذا رأيتموه فأفطروا، فإن غم عليكم فصوموا ثلاثين يوما.
Imam Ahmad narrated it (7516), and Ibn Khuzayma (1908) and Ibn Hibban (3443) both graded it sahih, all of them from the hadith of Zuhri, from Abu Salama bin Abdul-Rahman, from Abu Hurairah, who mentioned it. Its isnad is sahih.