Moses wrote the song on the same day that Yahweh told him to write it and then he taught it to the people of Israel on that same day.