The Messenger of Allah ﷺ does not know when the Hour will be
Allah commands His Messenger to say to the people that he has no knowledge of when the Hour will be and he does not know whether its time is near or far.
قُلْ إِنْ أَدْرِى أَقَرِيبٌ مَّا تُوعَدُونَ أَمْ يَجْعَلُ لَهُ رَبِّى أَمَداً
(Say: "I know not whether which you are promised is near or whether my Lord will appoint for it a distant term.") meaning, a long period of time. In this noble Ayah is an evidence that the Hadith that many of the ignorant people often circulate, which says that the Prophet will not remain under the earth more than one thousand years (i.e., the Hour will be before that period) is a baseless lie. We have not seen it in any of the Books (of Hadith). Verily, the Messenger of Allah ﷺ was asked about the time of the Hour and he would not respond. When Jibril appeared to him in the form of a bedouin Arab, one of the questions he asked the Prophet was, "O Muhammad! Tell me about the Hour" So the Prophet replied,
Continue reading the tafsir of ayahs 25–28Ma'arif al-Qur'an
Mufti Muhammad Shafi
Difference between 'Knowledge of the Unseen' and 'Reports of the Unseen Events'
The exception made here is the response to the doubt raised by unintelligent people. The negation of the total knowledge of the Unseen does not necessarily entail absolute negation of every unknown secret. For the office of risalah, a Messenger needs a certain amount of knowledge of unseen things which Allah grants him through revelation. When Allah sends down the revelation to His Holy Prophet ﷺ ، He sends it down under His special protection, and is completely secure against being distorted or tampered with by devils. First of all, the word rasul [ Messenger ] determines the type of knowledge granted to a Prophet or a Messenger. Evidently, it is the knowledge of the sacred laws and injunctions in its totality, and of the unseen events according to the exigency of time. The next statement states the heavily protected manner in which the unseen knowledge is granted. It is sent down through angels around whom are posted other angels as sentinels. This explanation clarifies the point that the exceptive sentence that affirms the unseen knowledge granted to a Holy Prophet ﷺ and a Messenger is a specialized unseen knowledge which is essential and relevant to the proper functioning of a Prophetic office.
Technically, this 'exception', in Arabic grammar, is referred to as istithna' munqati` which may be defined as the exceptive sentence in which the exception is severed from, or wholly different in kind from, the general description given before. In this sense, whilst the basic sentence negated total Unseen Knowledge in general terms for anyone besides Allah, the exceptive sentence does not affirm it. It merely affirms specialized acquaintance with some reports of the unseen events which the Qur'an frequently describes as anba'ul ghaib أَنبَاءِ الْغَيْبِ , thus, for instance:
تِلْكَ مِنْ أَنبَاءِ الْغَيْبِ نُوحِيهَا إِلَيْكَ
'These are some reports from the unseen [ events ] which We reveal to you. [ 11:49] '
Some unintelligent people do not grasp the distinction between 'Knowledge of the Unseen' and 'reports of the unseen events'. As a result, they attempt to prove 'total knowledge of the Unseen' for the Prophets of Allah, especially for the Last Prophet ﷺ . They believe that the Holy Prophet ﷺ ، like Allah, is omniscient - having knowledge of every particle of the universe. This is clearly shirk - assigning to the Holy Prophet ﷺ the status of Godhead, God forbid! If any person discloses a secret to a friend of his, of which no one else has that piece of knowledge or information, such a friend cannot be described as omniscient. Likewise, Allah has granted thousands of pieces of information of the unseen world through revelation to His Holy Prophets ﷺ ، but it is not true to say that they are omniscient. The ignorant laity do not understand the difference between the concepts. When they are told that the Holy Prophet ﷺ is not omniscient, they understand this statement to imply that the Holy Prophet ﷺ [ God forbid!] did not have any information about anything unseen. No believer in the world ever holds such a belief, nor can he ever do so because if anyone does so the whole structure of nubuwwah and risalah would come crumbling down. It is not possible for any believer to behave in this way.
The entire system of the present world has been formulated with the aim of putting human beings to the test. Therefore reality is revealed here solely to the extent of conveying the divine message. Had there been no human trial to be considered, and had the concealing veils been removed, the people would have seen that, from the angels to the righteous among the jinn, all acknowledge the god-head of God and the whole universe testifies to this.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.