From Sahih Muslim (Hadith 2501):
Ubaidullah narrated on the authority of the same chain of transmitters that the Messenger of Allah (ﷺ) made a mention of Ramadan and said:The month may consist of twenty-nine days, and it may be thus, thus and thus, and (he further) said: Calculate it, but he did not say thirty
Reference: Muslim 2501