In the lifetime of the Prophet (ﷺ) the sun eclipsed and then he offered a two rak`at prayer.
Sahih al-Bukhari Book 16, Hadith 21