"The Prophet swore an oath of abstention from his wives for a month and stayed in his room for twenty-nine days. It was said: 'O Messenger of Allah, did you not swear an oath of abstention for a month?' He said: 'This month is twenty-nine days.'"
Sunan an-Nasa'i Book 27, Hadith 68