In Parshas Vayechi, Rashi explains that Yaakov wished to reveal to his sons when the end of Israel's exile would finally take place (ha'keitz), but the prophetic vision was closed off from him.
Rabbeinu Bachye elaborated on Rashi's words: Yaakov observed that the letters ח and ט do not appear in any of the brother's names. These are the two main letters of the word חט- sin. Yaakov took the fact that the brothers' names did not contain this word as an indication that they were clean of sin and worthy of being told when the future redemption would occur.
But then Yaakov noticed that the letters ק and ץ, which together spell the word קץ (keitz - the end of the exiles) also do not appear in their names. At that point Yaakov thought that perhaps his sons were not worthy of knowing this secret after all.
Because of his hesitation, Yaakov kept the secret closed and did not reveal the information to his sons.
Source: Rabbi Yisrael Bronstein
Source: Rabbi Yisrael Bronstein
Surely, if Yaakov would have indeed revealed the time of Moshiach's coming to his children they would have been totally devastated to hear that they had so long to wait.
When Yaakov's sons would hear that Moshiach was not scheduled to come for a long time, they would have realized that some considerable additional effort was needed to bring him sooner - as the Talmud states that through additional merit the Redemption comes earlier [Sanhedrin 98a].
Thus, Yaakov hoped that by revealing that ''the End of Days'' was a long way off it would motivate his children to add substantially in Divine Service, so as to bring Moshiach sooner.
Nevertheless, despite his good intentions ''the Shechinah departed from him'' and Yaakov found himself unable to reveal the ''End of Days''. For, ultimately, God wants us to bring Moshiach through our own efforts, and not through the assistance of ''revelations'' from above.
Source: Based on Likutei Sichos Lubavitcher Rebbe vol 20 pp228