ENOfficial
It was narrated from Ubayy bin Ka’b that: The Prophet (ﷺ) used to spend the last ten days of Ramadan in I’tikaf. One year he was traveling, so the following year he spent twenty days in I’tikaf.
Source: sunnah.com
Other translations
Arabic
حَدَّثَنَا مُحَمَّدُ بْنُ يَحْيَى، حَدَّثَنَا عَبْدُ الرَّحْمَنِ بْنُ مَهْدِيٍّ، عَنْ حَمَّادِ بْنِ سَلَمَةَ، عَنْ ثَابِتٍ، عَنْ أَبِي رَافِعٍ، عَنْ أُبَىِّ بْنِ كَعْبٍ، أَنَّ النَّبِيَّ ـ صلى الله عليه وسلم ـ كَانَ يَعْتَكِفُ الْعَشْرَ الأَوَاخِرَ مِنْ رَمَضَانَ فَسَافَرَ عَامًا فَلَمَّا كَانَ مِنَ الْعَامِ الْمُقْبِلِ اعْتَكَفَ عِشْرِينَ يَوْمًا .
sunnah.com