Sahih al-Bukhari, Hadith 6684

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."

حَدَّثَنَا عَبْدُ الْعَزِيزِ بْنُ عَبْدِ اللَّهِ، حَدَّثَنَا سُلَيْمَانُ بْنُ بِلاَلٍ، عَنْ حُمَيْدٍ، عَنْ أَنَسٍ، قَالَ آلَى رَسُولُ اللَّهِ صلى الله عليه وسلم مِنْ نِسَائِهِ، وَكَانَتِ انْفَكَّتْ رِجْلُهُ، فَأَقَامَ فِي مَشْرُبَةٍ تِسْعًا وَعِشْرِينَ لَيْلَةً، ثُمَّ نَزَلَ فَقَالُوا يَا رَسُولَ اللَّهِ آلَيْتَ شَهْرًا‏.‏ فَقَالَ ‏{‏إِنَّ الشَّهْرَ يَكُونُ تِسْعًا وَعِشْرِينَ‏}‏

sunnah.com