Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:7932Abū ʿAbdullāh al-Ḥāfiẓ > ʿAbd al-Raḥman b. al-Ḥasan al-Qāḍī > Ibrāhīm b. al-Ḥusayn > Ādam > Shuʿbah > Muḥammad b. Ziyād > Abū Hurayrah

[Machine] The Messenger of Allah ﷺ said, or Abu Al-Qasim ﷺ said, "Fast upon sighting the crescent moon and break your fast upon sighting it. But if it is cloudy and you cannot see it, complete the month of Sha'ban as thirty days."  

البيهقي:٧٩٣٢أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ أَخْبَرَنِي عَبْدُ الرَّحْمَنِ بْنِ الْحَسَنِ الْقَاضِي ثنا إِبْرَاهِيمُ بْنُ الْحُسَيْنِ ثنا آدَمُ ثنا شُعْبَةُ ثنا مُحَمَّدُ بْنُ زِيَادٍ قَالَ سَمِعْتُ أَبَا هُرَيْرَةَ يَقُولُ

قَالَ رَسُولُ اللهِ ﷺ أَوْ قَالَ أَبُو الْقَاسِمِ ﷺ صُومُوا لِرُؤْيَتِهِ وَأَفْطِرُوا لِرُؤْيَتِهِ فَإِنْ غُمَّ عَلَيْكُمْ فَعُدُّوا ثَلَاثِينَ يَوْمًا يَعْنِي عُدُّوا شَعْبَانَ ثَلَاثِينَ  

رَوَاهُ الْبُخَارِيُّ فِي الصَّحِيحِ عَنْ آدَمَ بْنِ أَبِي إِيَاسٍ إِلَّا أَنَّهُ قَالَ فِي الْحَدِيثِ فَإِنْ غُمَّ عَلَيْكُمْ فَأَكْمِلُوا عِدَّةَ شَعْبَانَ ثَلَاثِينَ

See similar narrations below:

Collected by Bukhārī

The beginning and ending of the Ramadan is based on the moon

bukhari:1909Ādam > Shuʿbah > Muḥammad b. Ziyād > Abū Hurayrah

that the Prophet ﷺ said or he said Abū al-Qasim said, "˹Start˺ fasting ˹the month˺ upon seeing it (the moon), and break ˹fasting the month˺ upon seeing it. If it is hidden for you (as a result of an overcast at the start of the month), then complete thirty days of Shaʿbān."  

البخاري:١٩٠٩حَدَّثَنَا آدَمُ؛ حَدَّثَنَا شُعْبَةُ؛ حَدَّثَنَا مُحَمَّدُ بْنُ زِيَادٍ؛ قَالَ؛ سَمِعْتُ أَبَا هُرَيْرَةَ ؓ يَقُولُ

قَالَ النَّبِيُّ ﷺ أَوْ قَالَ قَالَ أَبُو الْقَاسِمِ ﷺ «صُومُوا لِرُؤْيَتِهِ وَأَفْطِرُوا لِرُؤْيَتِهِ فَإِنْ غُبِّيَ عَلَيْكُمْ فَأَكْمِلُوا عِدَّةَ شَعْبَانَ ثَلاَثِينَ۔»