Messenger of Allah ﷺ was informed that I had taken an oath to fast daily and to pray (every night) all the night throughout my life (so Messenger of Allah ﷺ came to me and asked whether it was correct): I replied, "Let my parents be sacrificed for you! I said so." The Prophet ﷺ said, "You can not do that. So, fast for few days and give it up for few days, offer Salat (prayer) and sleep. Fast three days a month as the reward of good deeds is multiplied ten times and that will be equal to one year of fasting." The Prophet ﷺ said to me, "Fast one day and give up fasting for two days." I replied, "I can do better than that." The Prophet ﷺ said to me, "Fast one day and give up fasting for a day and that is the fasting of Prophet David and that is the best fasting." I said, "I have the power to fast better (more) than that." The Prophet ﷺ said, "There is no better fasting than that."
أُخْبِرَ رَسُولُ اللَّهِ ﷺ أَنِّي أَقُولُ وَاللَّهِ لأَصُومَنَّ النَّهَارَ وَلأَقُومَنَّ اللَّيْلَ مَا عِشْتُ فَقُلْتُ لَهُ قَدْ قُلْتُهُ بِأَبِي أَنْتَ وَأُمِّي قَالَ فَإِنَّكَ لاَ تَسْتَطِيعُ ذَلِكَ فَصُمْ وَأَفْطِرْ وَقُمْ وَنَمْ وَصُمْ مِنَ الشَّهْرِ ثَلاَثَةَ أَيَّامٍ فَإِنَّ الْحَسَنَةَ بِعَشْرِ أَمْثَالِهَا وَذَلِكَ مِثْلُ صِيَامِ الدَّهْرِ قُلْتُ إِنِّي أُطِيقُ أَفْضَلَ مِنْ ذَلِكَ قَالَ فَصُمْ يَوْمًا وَأَفْطِرْ يَوْمَيْنِ قُلْتُ إِنِّي أُطِيقُ أَفْضَلَ مِنْ ذَلِكَ قَالَ فَصُمْ يَوْمًا وَأَفْطِرْ يَوْمًا فَذَلِكَ صِيَامُ دَاوُدَ عَلَيْهِ السَّلاَمُ وَهْوَ أَفْضَلُ الصِّيَامِ فَقُلْتُ إِنِّي أُطِيقُ أَفْضَلَ مِنْ ذَلِكَ فَقَالَ النَّبِيُّ ﷺ لاَ أَفْضَلَ مِنْ ذَلِكَ