I'd like to write a little bit of analysis on the Midrash Ne'elam of Parshat Toldot, referring to the timing of Techiyat HaMeitim. See here for a translation of the relevant section. I encourage reading the original Hebrew/Aramaic text.
- The general Techiyat HaMeitim of the average person in Israel will be at the end of 408 years of the 6th millenium. Due to the nature of the language used, it appears that an extra line may have been added to indicate that this is the year 5408 exactly.
- Techiyat HaMeitim of the Tsaddikim will preceed this ending point by either 210 or 214 years.
- This year of Techiyat HaMeitim of the Tsaddikim will be after 40 years of tranquility, the beginning of which is called Kibbutz Galuyot. It is not 40 years of the actual ingathering, per the text, but a starting point which is called Kibbutz Galuyot. Furthermore, these 40 years will be without trouble for Am Yisrael. See the beginning of Midrash Ne'elam on daf 139b: "and from the time that the troubles pass until the resurrection of the dead is 40 years".