Mishkat al-Masabih #2008
Fasting
The Arabic includes the chain of narration (sanad) and the collector's commentary; the English translation shows the Prophet's words only.
عَنْ أَنَسٍ قَالَ: كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَعْتَكِفُ فِي الْعَشْرِ الْأَوَاخِرِ مِنْ رَمَضَانَ فَلَمْ يَعْتَكِفْ عَامًا. فَلَمَّا كَانَ الْعَامُ الْمقبل اعْتكف عشْرين. رَوَاهُ التِّرْمِذِيّ
وَرَوَاهُ أَبُو دَاوُدَ وَابْنُ مَاجَهْ عَنْ أَبِي بن كَعْب
Anas said that the Prophet was accustomed to engage in private devotion in the mosque during the last ten nights of Ramadan; but one year he omitted it and he engaged in it during twenty nights the next year.
Tirmidhi transmitted it, and Abu Dawud and Ibn Majah transmitted it from Ubayy b. Ka'b.
Topics
About Mishkat al-Masabih
This hadith is #2008 from Mishkat al-Masabih, in the Book of Fasting.