The Messenger's knowledge of the Ghayb

A: The basic rule concerning matters related to the Ghayb is that they are known only to Allah. He (Exalted be He) says: And with Him are the keys of the Ghaib (all that is hidden), none knows them but He. And He knows whatever there is in the land and in the sea; not a leaf falls, but he knows it. There is not a grain in the darkness of the earth nor anything fresh or dry, but is written in a Clear Record. Allah (Exalted be He) also says: Say: "None in the heavens and the earth knows the Ghaib (Unseen) except Allâh, nor can they perceive when they shall be resurrected." However, Allah (Exalted be He) informed those He chose from among His Messengers of some matters related to the Ghayb. Allah (Exalted be He) says: "(He Alone is) the All-Knower of the Ghaib (Unseen), and He reveals to none His Ghaib (Unseen)." Except to a Messenger (from mankind) whom He has chosen (He informs him of unseen as much as He likes), and then He makes a band of watching guards (angels) to march before him and behind him. Allah (Exalted be He) also says: (Part No. 2; Page No. 169)  Say (O Muhammad صلى الله عليه وسلم): "I am not a new thing among the Messengers (of Allâh i.e. I am not the first Messenger) nor do I know what will be done with me or with you. I only follow that which is revealed to me, and I am but a plain warner." It is confirmed in a long Hadith reported on the authority of Um Al-`Ala' that she said, "When `Uthman ibn Mazh`un died, we covered him with his clothes. The Messenger of Allah (peace be upon him) then came to us and I said (addressing the deceased), 'O Abu Al-Sa'ib! I bear witness that Allah (Glorified and Exalted be He) has honored you.' The Messenger of Allah (peace be upon him) said, 'How do you know that Allah has honored him?' I replied, 'I do not know. May my father and mother be sacrificed for you, O Messenger of Allah!' The Messenger (peace be upon him) said, 'As for him, the certainly from his Lord (death) has overtaken him, and I hope all good for him. By Allah! Although I am the Messenger of Allah, yet I do not know what He (Allah) will do with me.' I said, 'By Allah! I will never assert the piety of anyone after him.'" Related by Ahmad and Al-Bukhari in his Sahih [Book of Authentic Hadith], Kitab Al-Jana'iz [Book of Funerals]. In another narration from Al-Bukhary [the Prophet (peace be upon him) said,] I do not know, although I am the Messenger of Allah, what He will do with him. It is reported in many Hadith that Allah informed the Prophet (peace be upon him) of the end of some of his Sahabah (Companions), and gave them the good news that they would be admitted into Jannah (Paradise). It is also reported on the authority of `Umar ibn Al-Khattab (may Allah be pleased with him) in Al-Bukhari and Muslim that Jibril (Gabriel) asked the Prophet (peace be upon him) about the Hour, and he replied, The one being asked about it does not know more than the one asking. He then just told Jibril about its signs. This signifies that he (peace be upon him) only knew what Allah informed him of the Ghayb, which He conveyed when necessary.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.