The sun was eclipsed during the lifetime of the Messenger of Allah ﷺ. The Messenger of Allah ﷺ went out to the mosque, stood, and pronounced the takbir, and the people lined up in rows behind him. He completed four bowings and four prostrations, and the sun cleared before he finished.
أخبرنا محمد بن خالد بن خلي قال حدثنا بشر بن شعيب عن أبيه عن الزهري قال أخبرني عروة بن الزبير أن
كسفت الشمس في حياة رسول الله ﷺ فخرج رسول الله ﷺ إلى المسجد فقام فكبر وصف الناس وراءه فاستكمل أربع ركعات وأربع سجدات وانجلت الشمس قبل أن ينصرف
Bukhari transmitted it in the Book of the Eclipse, Chapter on the Imam's Sermon during the Eclipse, hadith no. 1046, and Muslim, hadith no. 3/901 (see the previous hadith), from the hadith of Zuhri, at greater length, and it is in Kubra, hadith no. 1850.