The Messenger of Allah ﷺ swore to abstain from his wives, and his foot had been sprained, so he stayed in an upper chamber for twenty-nine nights and then came down.They said, "Messenger of Allah, you swore to abstain for a month?"He replied, "A month can be twenty-nine days."
آلى رسول الله ﷺ من نسائه، وكانت انفكت رجله، فأقام في مشربة تسعا وعشرين ليلة، ثم نزل. فقالوا: يا رسول الله، آليت شهرا؟ فقال: إن الشهر يكون تسعا وعشرين.
Bukhari narrated it in "The Book of Fasting" (1911), from Abdul-Aziz bin Abdullah, who said, "Sulayman bin Bilal narrated to us, from Humayd (that is, al-Tawil), from Anas," and he related it.He also narrated it in "The Book of Prayer" (378) via Yazid bin Harun, who said, "Humayd al-Tawil informed us," with the same chain, but with a fuller account, in which it mentions ﷺ praying with his companions while sitting, while they were standing. It also includes his saying, "The imam is appointed only so that he may be followed..." the hadith in full.