CALCULATING THE TIME OF THE REDEMPTION
Gemara
3a - Yonasan ben Uzi'el revealed the translation of Nevi'im, which he received from Chagai, Zecharyah and Malachi.
Eretz Yisrael shook 400 Parsa'os, and a voice from Heaven protested that secrets are being revealed.
Yonasan replied that his only intention was to prevent disputes. He wanted to reveal the translation of Kesuvim. A Heavenly voice told him that he had already revealed enough.
Question: Why was he allowed to reveal the translation of Nevi'im, but not of Kesuvim?
Answer: The translation of Kesuvim contains Ketz ha'Moshi'ach.
11b - Rava: Belshatzar calculated (when the 70 years of exile before rebuilding the Mikdash should have finished). He erred, for he counted from 'l'Malchus Bavel', not from "l'Bavel" (the first exile to Bavel).
Achashverosh thought that he will not err, but he also erred. He counted from Galus Yehoyachin, instead of from the Churban of Yerushalayim.
Also Daniel miscalculated! "Ani Daniel Binosi bi'Sforim" connotes that he had erred.
Sanhedrin 97b - Beraisa - R. Noson: "Ki Od Chazon la'Mo'ed; Im Yismahme'ah Chake Lo" - we cannot know for sure when Moshi'ach will come.
Do not rely on Chachamim who expound "Ad Idan v'Idanin u'Flag Idan" (Daniel said that Moshi'ach will come after (1400 years,) three and a half times the length of Galus Mitzrayim);
Do not rely on R. Simlai who expounds "Va'Tashkemo bi'Dma'os Shalish" (the combined durations of Galus Mitzrayim and Galus Bavel are a third of Galus Edom, which will be 1410 years);
Question: What does it mean "V'Yafe'ach la'Ketz v'Lo Yechazev"?
Answer (R. Shmuel bar Nachmani): Tifach (should be bloated) people who calculate Ketz ha'Moshi'ach, for they say that if he does not come by their predicted date, he will never come;
Rather, "Chake Lo" (wait for him).
Midas ha'Din is delaying Moshi'ach.
Question: If so, why should we wait for him?
Answer: We wait in order to receive reward - "Ashrei Kol Chochei Lo".
Rishonim
Rambam (Hilchos Melachim 12:2): Some say that a Navi will come to return Yisrael in Teshuvah before the war of Gog and Magog... Some say that Eliyahu will come before Moshi'ach... No one can know these things until they will be. It is not clear from the Nevi'im, and Chachamim do not have a tradition. It is not important for us to know the order of events. A person should not make them primary, for they do not lead to love or fear of Hash-m. Similarly, one should not calculate deadlines (for Moshi'ach). Chachamim said that people who calculate Ketzim should be bloated. Rather, one should wait and trust that it will occur.
The Rambam (Igeres Teiman 283 p.152, cited in Gilyon of Frankel Rambam) says that Rav Sadya Gaon calculated a Ketz even though he knew that this is forbidden. His generation had corrupt ideas and he needed to bolster them lest Torah be forgotten. The Rambam (ibid. p.176) cites a Ketz which he received from his father.
The Ramban (Bereishis 3:2) calculates a Ketz. The Chasam Sofer (Teshuvos 6:61) disagrees with the Ramban's calculation and says that at the earliest, the Ketz must be about 400 years later.
Acharonim
Maharsha (Sanhedrin 97b DH Anu): The Gemara asked why should we wait for Moshi'ach because Moshi'ach will come only when we cease to think about him.
Iyun Yakov (Sanhedrin 97b DH Tifach): The punishment for people who calculate Ketzim (Tifach Atzmosav) is the ruining of the bone from which the dead will be revived. When their dates passes and Moshi'ach did not come they despair, therefore they will not be revived.
Margoliyos ha'Yam (Sanhedrin 97b 10): The Isur to calculate the Ketz applies only to people who say that if he does not come by their predicted date, he will never come. People who believe that he surely will come may calculate the Ketz to invigorate the wavering. Many Gedolei Yisrael did so. Often, great salvations occurred in the predicted times, but the generation was not worthy for it to be the ultimate Ge'ulah. "Madu'a Lo Va Ven Yishai El ha'Lechem Gam Temol Gam ha'Yom?" "Madu'a Lo Kilisem Chokchem...Gam Temol Gam ha'Yom?"! (Moshi'ach did not come because Yisrael did not fulfill their obligation.
Kad ha'Kemach (of R. Bechayei, Sof Ge'ulah): It says in Daniel (12:12) "Happy is he who waits for the days 1,335". It is known that there are three Ketzim for our Galus, just like there were for Galos Mitzrayim.