The Messenger of Allah ﷺ said to me, "The most beloved fasting to Allah is the fasting of Dawud. He used to fast one day and break his fast the next. And the most beloved prayer to Allah is the prayer of Dawud. He used to sleep for half the night, stand in prayer for a third of it, and sleep for the final sixth."
قال لي رسول الله ﷺ: أحب الصيام إلى الله صيام داود، كان يصوم يوما ويفطر يوما. وأحب الصلاة إلى الله صلاة داود، كان ينام نصف الليل ويقوم ثلثه وينام سدسه.
Bukhari narrated it in the Hadiths of the Prophets (3420), and Muslim in the Book of Fasting (1159:190), both from the hadith of Amr bin Dinar, that Amr bin Aws said, Abdullah bin Amr bin As informed us, and he mentioned it. The wording given is Bukhari's, and Muslim's wording is close to it.