Anas bin Malik reported,

The Messenger of Allah ﷺ took an oath to abstain from his wives, and his foot had been sprained, so he stayed in an upper chamber for twenty-nine nights. Then he came down, and they said, "Messenger of Allah, you swore to abstain for a month."He replied, "A month can be twenty-nine days."

Bukhari 6684

Sahih

حدثنا عبد العزيز بن عبد الله حدثنا سليمان بن بلال عن حميد

عن أنس قال

آلى رسول الله ﷺ من نسائه وكانت انفكت رجله فأقام في مشربة تسعا وعشرين ليلة ثم نزل فقالوا يا رسول الله آليت شهرا فقال إن الشهر يكون تسعا وعشرين

البخاري 6684صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Oaths and vows
Chapter
One who swore not to enter upon his family for a month, and the month was twenty-nine days
Numbering
Darussalam 6684
Bukhari 6684