Sunan an-Nasa'i, Hadith 2118 ⓘ
Narrated It was narrated that Abu Hurairah said: : "The Messenger of Allah said: 'Fast when you see it and stop fasting when you see it, and if it is obscured from you (too cloudy), then count it as thirty (days).'"
أَخْبَرَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ يَزِيدَ، قَالَ حَدَّثَنَا أَبِي قَالَ، حَدَّثَنَا وَرْقَاءُ، عَنْ شُعْبَةَ، عَنْ مُحَمَّدِ بْنِ زِيَادٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " صُومُوا لِرُؤْيَتِهِ وَأَفْطِرُوا لِرُؤْيَتِهِ فَإِنْ غُمَّ عَلَيْكُمْ فَاقْدُرُوا ثَلاَثِينَ " .
also referenced under: Book 22, Hadith 29 (In-Book) & Volume 3, Book 22, Hadith 2120 (DarusSalam)