Ilm-e-Ghaib (knowledge of the unseen) ofcouse Allah has it. Allah knows everything, but Allah also grants His Chosen People (Prophets, Sahaba, Saints) Ilm-e-Ghaib. As we know from Ahadith, Prophet (Sallalaho Alahe Wasulum) has already told us signs of Qayamat, but Qayamat still hasn’t arrived yet. So that’s Ilm-e-Ghaib which was given to Prophet (Sallalaho Alahe Wasulum) by Allah.
So our belief should be that Allah has Zati Ilm-e-Ghaib meaning He has it Himself, no one gave it to him, but Ilm-e-Ghaib of Prophets, Sahaba, Saints etc is Ataye meaning granted to them by Allah. They only know what Allah granted them, so the Ilm-e-Ghaib of creation is limited where as Allah’s Ilm-e-Ghaib has no limits.