(20) باب مَنْ حَلَفَ أَنْ لاَ يَدْخُلَ عَلَى أَهْلِهِ شَهْرًا، وَكَانَ الشَّهْرُ تِسْعًا وَعِشْرِينَ
Narrated Anas:
Allah's Messenger (ﷺ) took an oath for abstention from his wives (for one month), and during those days he had a sprain in his foot. He stayed in a Mashrubah (an upper room) for twenty-nine nights and then came down. Then the people said, "O Allah's Messenger (ﷺ)! You took an oath for abstention (from your wives) for one month." On that he said, "A (lunar) month can be of twenty-nine days."
Reference: Sahih al-Bukhari 6684
In-book reference: Book 83, Hadith 61
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 8, Book 78, Hadith 675