(2) بَاب وُجُوبِ صَوْمِ رَمَضَانَ لِرُؤْيَةِ الْهِلَالِ وَالْفِطْرِ لِرُؤْيَةِ الْهِلَالِ وَأَنَّهُ إِذَا غُمَّ فِي أَوَّلِهِ أَوْ آخِرِهِ أُكْمِلَتْ عِدَّةُ الشَّهْرِ ثَلَاثِينَ يَوْمًا
'Abdullah b. Umar (Allah be pleased with both of them) reported Allah's Measenger (ﷺ) as saying:
When you see the new moon, observe fast, and when you see it (again) then break it, and if the sky is cloudy for you, then calculate it.
Reference: Sahih Muslim 1080 g
In-book reference: Book 13, Hadith 10
USC-MSA web (English) reference(deprecated numbering scheme): Book 6, Hadith 2369