The Prophet ﷺ was informed that I was fasting continuously and praying through the night. He either sent for me or met me, and he said, "Have I not been told that you fast without breaking your fast and pray all night? Do not do that, for your eye has a right over you, your body has a right over you, and your family has a right over you. So fast and break your fast, pray and sleep. Fast one day out of every ten, and you will have the reward of nine."I said, "I find myself stronger than that, Prophet of Allah."He said, "Then fast the fast of Dawud ."I asked, "How did Dawud fast, Prophet of Allah?"He replied, "He would fast one day and break his fast the next, and he would not flee when he met the enemy."Then he mentioned the rest of the hadith, which will appear in the chapter on the prohibition of fasting perpetually.
بلغ النبي ﷺ أني أسرد الصوم، وأصلي الليل، فإما أرسل إلي وإما لقيته، فقال: ألم أخبر أنك تصوم ولا تفطر، وتصلي الليل؟ فلا تفعل؛ فإن لعينك حظا، ولنفسك حظا، ولأهلك حظا، فصم وأفطر، وصل ونم، وصم من كل عشرة أيام يوما، ولك أجر تسعة. قال: إني أجدني أقوى من ذلك يا نبي الله. قال: فصم صيام داود عليه السلام. قال: وكيف كان داود يصوم يا نبي الله؟ قال: كان يصوم يوما ويفطر يوما، ولا يفر إذا لاقى ثم ذكر بقية الحديث وسيأتي في باب النهيي عن صوم الدهر.
Bukhari narrated it in the Book of Fasting (1977), and Muslim in the Book of Fasting (1159: 186), both from the hadith of Ibn Jurayj, who said, I heard Ataa claim that Abu Abbas informed him that he heard Abdullah bin Amr bin As, and he related it. The wording given is Muslim's, and Bukhari did not mention, "and fast one day out of every ten," in the place referred to.