Umar bin Khattab reported,

"Messenger of Allah, during the days of ignorance I made a vow that I would spend a night in spiritual retreat in Masjid al-Haram."The Prophet ﷺ said, "Then fulfill your vow."In the reports of Abu Usama and Thaqafi, it is a retreat of one night. In the report of Shuba, he said that he had bound himself to a day of retreat. In the report of Hafs, there is no mention of either a day or a night.

Muslim 4293

Sahih

و حدثنا أبو سعيد الأشج حدثنا أبو أسامة ح و حدثنا محمد بن المثنى حدثنا عبد الوهاب يعني الثقفي ح و حدثنا أبو بكر بن أبي شيبة ومحمد بن العلاء وإسحق بن إبراهيم جميعا عن حفص بن غياث ح و حدثنا محمد بن عمرو بن جبلة بن أبي رواد حدثنا محمد بن جعفر حدثنا شعبة كلهم عن عبيد الله عن نافع عن ابن عمر و قال حفص من بينهم عن عمر بهذا الحديث أما أبو أسامة والثقفي ففي حديثهما اعتكاف ليلة وأما في حديث شعبة فقال جعل عليه يوما يعتكفه وليس في حديث حفص ذكر يوم ولا ليلة

مسلم 4293صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Oaths
Chapter
Vow of the disbeliever and what to do about it if he becomes Muslim
Numbering
Darussalam 4293
Muslim 4293