Humayd narrates from Sayyiduna Anas (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) took an oath of ila from his wives, and his (peace and blessings be upon him) foot was injured, so he (peace and blessings be upon him) stayed in an upper room for 29 nights, then came down. They said: "O Messenger of Allah (peace and blessings be upon him), you had sworn for a month." He (peace and blessings be upon him) said: "A month is sometimes 29 days."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الإيلاء / 15236