The Prophet ﷺ used to say between the tashahhud and the salutation, "O Allah, forgive me for what I have done before and what I will do later, what I have concealed and what I have done openly, what I have done to excess, and what You know better than I. You are the One who brings forward and You are the One who delays. There is no god but You." The hadith continues.
يقول النبي ﷺ بين التشهد والتسليم: اللهم اغفر لي ما قدمت، وما أخرت، وما أسررت وما أعلنت، وما أسرفت، وما أنت أعلم به مني، أنت المقدم، وأنت المؤخر، لا إله إلا أنت الحديث.
Muslim narrated it in "Travelers" (771) via Yusuf Majishun, from his father, from Abdul-Rahman Araj, from Ubaydullah bin Abu Rafi, from Ali . See the full hadith in the chapter on the opening of the prayer, but Abu Dawud narrated it (761) via Abdullah bin Fadl bin Rabia bin Harith bin Abdul-Muttalib, from Abdul-Rahman Araj with the same chain, saying he would say it upon finishing the prayer. If this is sahih, it should be understood as meaning that he would say it at one time during the prayer, and at another time upon finishing it.