Sunan an-Nasa'i, Book 1, Hadith 160 (Nasa'i 160)

Safwan bin 'Assal said:

"When we were with the Messenger of Allah (ﷺ) on a journey, he told us not to take them off for three days except in the case of Janabah, but not in the case of defecation, urinating or sleep."