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.
tirmidhi:3286ʿAbd b. Ḥumayd > ʿAbd al-Razzāq > Maʿmar > Qatādah > Anas

"The people of Makkah asked the Prophet ﷺ for a sign, so the moon was cleft asunder in Makkah two times (meaning two parts), so the following was revealed: 'The Hour has drawn near, and the moon has been cleft asunder, up to his saying: 'Magic, Mustamir (54:1 & 2)' meaning 'Going away.'"  

Abū ʿĪsá said that this Ḥadīth is Ḥasan-Ṣaḥīḥ.
الترمذي:٣٢٨٦حَدَّثَنَا عَبْدُ بْنُ حُمَيْدٍ حَدَّثَنَا عَبْدُ الرَّزَّاقِ عَنْ مَعْمَرٍ عَنْ قَتَادَةَ عَنْ أَنَسٍ قَالَ

سَأَلَ أَهْلُ مَكَّةَ النَّبِيَّ ﷺ آيَةً فَانْشَقَّ الْقَمَرُ بِمَكَّةَ مَرَّتَيْنِ فَنَزَلَت (اقتَرَبَتِ السَّاعَةُ وَانْشَقَّ الْقَمَرُ ) إِلَى قَوْلِهِ (سحْرٌ مُسْتَمِرٌّ ) يَقُولُ ذَاهِبٌ  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ

See similar narrations below:

Collected by Aḥmad, Ṭabarānī, Nasāʾī's Kubrá
ahmad:12688ʿAbd al-Razzāq > Maʿmar > Qatādah

"The people of Makkah asked the Prophet ﷺ for a sign, so the moon was cleft asunder in Makkah two times (meaning two parts), so the following was revealed: 'The Hour has drawn near, and the moon has been cleft asunder, up to his saying: 'Magic, Mustamir (54:1 & 2)' meaning 'Going away.'" (Using translation from Tirmidhī 3286)   

أحمد:١٢٦٨٨حَدَّثَنَا عَبْدُ الرَّزَّاقِ أَخْبَرَنَا مَعْمَرٌ عَنْ قَتَادَةَ

عَنْ أَنَسٍ سَأَلَ أَهْلُ مَكَّةَ النَّبِيَّ ﷺ آيَةً فَانْشَقَّ الْقَمَرُ بِمَكَّةَ مَرَّتَيْنِ فَقَالَ {اقْتَرَبَتِ السَّاعَةُ وَانْشَقَّ الْقَمَرُ وَإِنْ يَرَوْا آيَةً يُعْرِضُوا وَيَقُولُوا سِحْرٌ مُسْتَمِرٌّ} [القمر 2]  

tabarani:11642Aḥmad b. ʿAmr al-Bazzār > Muḥammad b. Yaḥyá al-Quṭaʿī > Muḥammad b. Bakr > Ibn Jurayj > ʿAmr b. Dīnār > ʿIkrimah > Ibn ʿAbbās

[Machine] The moon was split during the time of the Prophet Muhammad ﷺ . They said that it was a magic act made by the moon. Then the verse was revealed, "The Hour has come near, and the moon has split".  

الطبراني:١١٦٤٢حَدَّثَنَا أَحْمَدُ بْنُ عَمْرٍو الْبَزَّارُ ثنا مُحَمَّدُ بْنُ يَحْيَى الْقُطَعِيُّ ثنا مُحَمَّدُ بْنُ بَكْرٍ ثنا ابْنُ جُرَيْجٍ عَنْ عَمْرِو بْنِ دِينَارٍ عَنْ عِكْرِمَةَ عَنِ ابْنِ عَبَّاسٍ قَالَ

كُسِفَ الْقَمَرُ عَلَى عَهْدِ رَسُولِ اللهِ ﷺ فَقَالُوا سُحِرَ الْقَمَرُ فَنَزَلَتْ {اقْتَرَبَتِ السَّاعَةُ وَانْشَقَّ} الْقَمَرُ إِلَى قَوْلِهِ {مُسْتَمِرٌّ}  

nasai-kubra:11490Muḥammad b. ʿAbd al-Aʿlá > Muḥammad / Ibn Thawr > Maʿmar > Isḥāq b. Ibrāhīm > ʿAbd al-Razzāq > Maʿmar > Qatādah > Anas

[Machine] The people of Makkah asked the Prophet ﷺ for a sign, so the moon split in Makkah twice {And if they see a sign, they turn away and say, "This is continuous magic."} [Qamar 2] They say it is going away.  

الكبرى للنسائي:١١٤٩٠أَخْبَرَنَا مُحَمَّدُ بْنُ عَبْدِ الْأَعْلَى عَنْ مُحَمَّدٍ وَهُوَ ابْنُ ثَوْرٍ عَنْ مَعْمَرٍ وَأَخْبَرَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ قَالَ أَخْبَرَنَا عَبْدُ الرَّزَّاقِ قَالَ حَدَّثَنَا مَعْمَرٌ عَنْ قَتَادَةَ عَنْ أَنَسٍ قَالَ

سَأَلَ أَهْلُ مَكَّةَ النَّبِيَّ ﷺ آيَةً فَانْشَقَّ الْقَمَرُ بِمَكَّةَ مَرَّتَيْنِ {وَإِنْ يَرَوْا آيَةً يُعْرِضُوا وَيَقُولُوا سِحْرٌ مُسْتَمِرٌّ} [القمر 2] يَقُولُ ذَاهِبٌ