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

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

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

sunnah.com