Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:38:17

Be patient over what they say and remember Our servant, David, the possessor of strength; indeed, he was one who repeatedly turned back ˹to Allah˺.  

God, exalted be He, says: Bear patiently what they say and remember Our servant David, the one of fortitude, that is to say, ˹the one˺ of fortitude in worship: he used to fast every other day and keep vigil for half the night, sleep for a third and then keep vigil for the ˹last˺ sixth. Indeed he was a penitent ˹soul˺, always returning to what pleases God.
القرآن:٣٨:١٧

اصْبِرْ عَلَىٰ مَا يَقُولُونَ وَاذْكُرْ عَبْدَنَا دَاوُودَ ذَا الْأَيْدِ ۖ إِنَّهُ أَوَّابٌ  

قال تعالى: {اصبر على ما يقولون واذكر عبدنا داود ذا الأيد} أي القوة في العبادة كان يصوم يوما ويفطر يوما ويقوم نصف الليل وينام ثلثه ويقوم سدسه {إنه أوَّاب} رجّاع إلى مرضاة الله.