Our Prophet (saas) was illiterate, meaning he was unable to read or write. He had received no special madrassa training. Neither was he taught any foreign languages. Our Prophet (saas) only knew Arabic. Allah also bestowed on him innate knowledge and the hidden knowledge (ilm al-ladun). Hazrat Mahdi (as), who will appear in 1400 according to the Islamic calendar and who will be the greatest mujaddid (reviver), saint and final guide of the End Times, will receive no madrassa training, either, and will possess only innate knowledge and the hidden knowledge (ilm al-ladun). Allah will purify Hazrat Mahdi (as) in a single night, meaning that Hazrat Mahdi (as) will come into possession of very profound knowledge in the course of a single night.
Our Prophet (saas) tells us that Hazrat Mahdi (as) will be enlightened with such special knowledge in the words:
The Mahdi is from us, from the Ahl al-Bayt. ALLAH WILL PURIFY* HIM IN A NIGHT (* i.e., will forgive him, or give him success and the inspiration of wisdom and guidance). (Sunan Ibn Majah, vol:10, Bab: 34, p. 348)