Rashi on Daniel 12:11 seems to represent a timeline for the approach of the Moshiach (though I admit, I don't really understand it): [translation via chabad.org]
And from the time the daily sacrifice was removed: in order to place a silent abomination in its stead, are days of one thousand two hundred and ninety years since the daily sacrifice was removed until it will be restored in the days of our King Messiah, and this calculation coincides with the calculation of (8:14): “evening and morning, two thousand and three hundred” from the day of their exile to Egypt until the final redemption: Egyptian exile 210; From their Exodus until the First Temple 480; First Temple 410; Babylonian exile 70; Second Temple 420; Totaling 1590. The daily sacrifice was removed six years before the destruction, which equals 1584. Add 1290, and the total sum is 2874; like the numerical value of בֹּקֶר עֶרֶב [574] plus 2300 [2874].
In the next verse, Rashi comments,
Fortunate is he who waits etc.: Forty five years are added to the above number, for our King Messiah is destined to be hidden after he is revealed and to be revealed again. So we find in Midrash Ruth, and so did Rabbi Eleazar HaKalir establish (in the concluding poem of the morning service of the portion dealing with the month of Nissan): “and he will be concealed from them six weeks of years.”
I haven't found a citation in the midrash to Ruth, nor have I looked up Yotzer Parshat Hachodesh, but I am trying to understand the idea that the Moshiach will be revealed and then hidden and revealed (for 45 years? For 42 years?). Can anyone point me to discussions of this?