The Imams عليه السلام do have the knowledge of what was and will be, and that nothing is unknown to them عليه السلام

Al-Kāfi|Volume 1|Book 4|Chapter 48
Al-Kāfi

Book 4, Chapter 48

The Imams عليه السلام do have the knowledge of what was and will be, and that nothing is unknown to them عليه السلام

3ـ عَلِيُّ بْنُ مُحَمَّدٍ عَنْ سَهْلٍ عَنْ أَحْمَدَ بْنِ مُحَمَّدِ بْنِ أَبِي نَصْرٍ عَنْ عَبْدِ الْكَرِيمِ عَنْ جَمَاعَةَ بْنِ سَعْدٍ الْخَثْعَمِيِّ أَنَّهُ قَالَ كَانَ الْمُفَضَّلُ عِنْدَ أَبِي عَبْدِ الله (عَلَيْهِ السَّلام) فَقَالَ لَهُ الْمُفَضَّلُ جُعِلْتُ فِدَاكَ يَفْرِضُ الله طَاعَةَ عَبْدٍ عَلَى الْعِبَادِ وَيَحْجُبُ عَنْهُ خَبَرَ السَّمَاءِ قَالَ لا الله أَكْرَمُ وَأَرْحَمُ وَأَرْأَفُ بِعِبَادِهِ مِنْ أَنْ يَفْرِضَ طَاعَةَ عَبْدٍ عَلَى الْعِبَادِ ثُمَّ يَحْجُبَ عَنْهُ خَبَرَ السَّمَاءِ صَبَاحاً وَمَسَاءً.
3. Ali ibn Muhammad has narrated from Sahl from Ahmad ibn Muhammad ibn Aabu Nasr from ‘Abd al-Karim from Jama‘a ibn Sa‘d al-Khath‘ami who has said that al-Mufaddal was in the presence of abu ‘Abdallah عليه السلام. Al-Mufaddal asked the Imam عليه السلام the following. “May Allah, take my soul in service for your cause, does Allah command (his) servants to obey a servant and hide the news of the heavens from him?” The Imam عليه السلام said, Allah is by far much honorable, kind and caring towards His servants than to command them to obey a servant (of His) and then hide form him the news of the heavens mornings and evenings.”
  • Allamah Baqir al-Majlisi
    Mirʾāt al-ʿUqūl fī Sharḥ Akhbār Āl al-Rasūl (3/130)
  • Shaykh Baqir al-Behbudi
    Ṣaḥīḥ al-Kāfī