#When did David sing the song that Yahweh was the rock who rescued him?

David sang the song that Yahweh was his rock on the day that Yahweh rescued him out of the hand of Saul and all his enemies. [22:1-2]