The prophet Muhammad said that the most beloved prayer to Allah is that of David, who would pray for one third of the night after sleeping for half of the night and the remaining sixth part. He also said that the most beloved fasts to Allah are those of David, who would fast on alternate days.