Prophet Muhammad said that:
“The Mahdi shall be from the ahlul-Bayt and Allah will rectify him in one night”
He will make him good in one night. This is an interesting hadith because it tells us that the Mahdi in the younger portion of his life will not be as a practicing of a Muslim as he should be, he is not to the level of that he’s worthy of being, something will happen, we don’t know what, and in one night he shall repent and he shall become the most pious person on earth.
He will not be born like this; he will not be raised as a scholar, no… Prophet Muhammad said that “Allah will purify him in one night”. So the Mahdi will not be to the level of piety that we expect him to be but in one night Allah will cause him to repent as Ibn Kathir said: “He will repent from his ways and he will become basically the most pure person on earth”
We also know that in the time that he will come, as the Prophet said:
“He will come in the worst of the times that the entire earth shall be filled with evil and injustice”
And that is something that very rarely happens, that the entire earth you see fitnah and corruption, and you see Muslim blood being shed… that when it does occur; that it the time when we can expect the Mahdi to come.
Now the question arises that where shall he appear from?
Of course nobody knows the timing. If we know when Mahdi will appear, we will know when Jesus will come, and then we will know when the Day of Judgment will come… Nobody knows.
Any time somebody makes a prediction you can guarantee he’s a liar.
Allah says in the Quran: {No one knows what will happen tomorrow}
When the Mahdi comes, the Dajjal will come. The Prophet said:
“There is no fitnah that mankind has been afflicted with that is worse than the Dajjah (Antichrist)”
From the beginning of times until the Day of Judgment, there is no fitnah that is more severe to mankind than the Dajjal. We don’t want to be alive when the Dajjal comes. And in lifetime of the Mahdi, the Dajjal will come.
So we don’t know the timing