Yes, the Buddha made this announcement.
63. Then
the Blessed One said to the bhikkhus: "So, bhikkhus, I exhort you:
All compounded things are subject to vanish. Strive with
earnestness. The time of the Tathagata's Parinibbana is near. Three
months hence the Tathagata will utterly pass away."
Actually not only Buddha can foretell his death - many seasoned
practitioners and masters also foretold their death time.