Jami` at-Tirmidhi, Book 8, Hadith 9 (Tirmidhi 690)

Anas narrated:

"The Messenger of Allah vowed to stay away from his wives for a month, so he stayed in a loft for twenty-nine days. They said: 'O Messenger of Allah, your vow was for a month,' so he said: 'The month is twenty-nine (days).'"