The sun was eclipsed during the time of the Messenger of Allah ﷺ, so he stood and prayed. He prolonged the standing greatly, then bowed and prolonged the bowing greatly, then rose and prolonged the standing greatly, though it was shorter than the first standing. Then he bowed and prolonged the bowing, though it was shorter than the first bowing. Then he prostrated.Then he raised his head and prolonged the standing, though it was shorter than the first standing. Then he bowed and prolonged the bowing, though it was shorter than the first bowing. Then he rose and prolonged the standing, though it was shorter than the first standing. Then he bowed and prolonged the bowing, though it was shorter than the first bowing. Then he prostrated.He finished his prayer just as the sun had become clear again. He then addressed the people, praising Allah and glorifying Him, then said, "The sun and the moon are not eclipsed for the death of anyone, nor for his life. When you see that, pray, give in charity, and remember Allah ."He said, "Community of Muhammad, there is no one more jealous than Allah
that His male servant or female servant should commit fornication. Community of Muhammad, if you knew what I know, you would laugh little and weep much."
أخبرنا إسحق بن إبراهيم قال حدثنا عبدة قال حدثنا هشام بن عروة عن أبيه
خسفت الشمس على عهد رسول الله ﷺ فقام فصلى فأطال القيام جدا ثم ركع فأطال الركوع جدا ثم رفع فأطال القيام جدا وهو دون القيام الأول ثم ركع فأطال الركوع وهو دون الركوع الأول ثم سجد ثم رفع رأسه فأطال القيام وهو دون القيام الأول ثم ركع فأطال الركوع وهو دون الركوع الأول ثم رفع فأطال القيام وهو دون القيام الأول ثم ركع فأطال الركوع وهو دون الركوع الأول ثم سجد ففرغ من صلاته وقد جلي عن الشمس فخطب الناس فحمد الله وأثنى عليه ثم قال إن الشمس والقمر لا ينكسفان لموت أحد ولا لحياته فإذا رأيتم ذلك فصلوا وتصدقوا واذكروا الله عز وجل وقال يا أمة محمد إنه ليس أحد أغير من الله عز وجل أن يزني عبده أو أمته يا أمة محمد لو تعلمون ما أعلم لضحكتم قليلا ولبكيتم كثيرا
Bukhari narrated it in the Book of Oaths and Vows, chapter "How was the Oath of the Prophet?", h: 6631, from the hadith of Abdah, in abridged form, and also in the Book of Eclipses, chapter "Charity during the Eclipse," h: 1044, and elsewhere. Muslim narrated it in the Book of Eclipses, chapter "The Eclipse Prayer," h: 901, from the hadith of Hisham, in both abridged and lengthy forms. It is also found in Kubra, h: 1887.