Ash-Shama'il Al-Muhammadiyah, Book 43, Hadith 299 (In-Book)

Anas Radiyallahu 'Anhu reports: "Someone was asked about the saum of Rasulullah Sallallahu 'Alayhi Wasallam? He replied: 'It was his noble habit to fast on different occasions. In some months he fasted for so many days, that it was thought he would continue fasting. In other months he did not fast, we thought he would not fast now. It was also from his noble habits that if one wanted to observe Rasulullah Sallallahu 'Alayhi Wasallam performed salaah at night, it was possible, and if one wanted to observe Rasulullah Sallallahu 'Alayhi Wasallam sleep at night, this too was possible'".

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

also referenced under: Book 42, Hadith 282 (English)