In the lifetime of the Prophet ﷺ the sun eclipsed and the Prophet ﷺ stood up to offer the prayer with the people and recited a long recitation, then he performed a prolonged bowing, and then lifted his head and recited a prolonged recitation which was shorter than the first. Then he performed a prolonged bowing which was shorter than the first and then lifted his head and performed two prostrations. He then stood up for the second rakʿa and offered it like the first. Then he stood up and said, "The sun and the moon do not eclipse because of someone's life or death but they are two signs amongst the signs of Allah which He shows to His worshipers. So whenever you see them, make haste for the prayer."
كَسَفَتِ الشَّمْسُ عَلَى عَهْدِ رَسُولِ اللَّهِ ﷺ فَقَامَ النَّبِيُّ ﷺ فَصَلَّى بِالنَّاسِ فَأَطَالَ الْقِرَاءَةَ ثُمَّ رَكَعَ فَأَطَالَ الرُّكُوعَ ثُمَّ رَفَعَ رَأْسَهُ فَأَطَالَ الْقِرَاءَةَ وَهْىَ دُونَ قِرَاءَتِهِ الأُولَى ثُمَّ رَكَعَ فَأَطَالَ الرُّكُوعَ دُونَ رُكُوعِهِ الأَوَّلِ ثُمَّ رَفَعَ رَأْسَهُ فَسَجَدَ سَجْدَتَيْنِ ثُمَّ قَامَ فَصَنَعَ فِي الرَّكْعَةِ الثَّانِيَةِ مِثْلَ ذَلِكَ ثُمَّ قَامَ فَقَالَ إِنَّ الشَّمْسَ وَالْقَمَرَ لاَ يَخْسِفَانِ لِمَوْتِ أَحَدٍ وَلاَ لِحَيَاتِهِ وَلَكِنَّهُمَا آيَتَانِ مِنْ آيَاتِ اللَّهِ يُرِيهِمَا عِبَادَهُ فَإِذَا رَأَيْتُمْ ذَلِكَ فَافْزَعُوا إِلَى الصَّلاَةِ