Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) narrates: "The Messenger of Allah (peace and blessings be upon him) used to observe i'tikaf (spiritual retreat) in the last ten days (of Ramadan). One year he (peace and blessings be upon him) travelled and did not observe i'tikaf, then when the following year came, he (peace and blessings be upon him) observed i'tikaf for twenty days."
Hadith Referenceالأحاديث المختارة / مسند أبي بن كعب الأنصاري رضي الله عنه / 1196
Hadith Takhrij«أخرجه ابن خزيمة فى صحيحه برقم: 2455، وابن حبان فى صحيحه برقم: 3668، والضياء المقدسي فى الأحاديث المختارة برقم: 1198، 1199، 1200، والحاكم فى المستدرك برقم: 1608، والنسائي فى السنن الكبرى برقم: 3331، 3376، وأبو داود فى سننه برقم: 2459، وابن ماجه فى سننه برقم: 1839، والبيهقي فى السنن الكبرى برقم: 8656، وأحمد فى مسنده برقم: 21607، 21608، والطيالسي فى مسنده برقم: 556، وعبد بن حميد فى مسنده برقم: 181» «أخرجه فتح الباري برقم: 1939»