Al-Kāfi - Volume 3 > The Time of Salah (Prayer) In a Cloudy Day, Windy and One Who Has Performed Salah (Prayer) Without Facing the Direction of Qiblah
Hadith #9

9ـ مُحَمَّدُ بْنُ يَحْيَى عَنْ أَحْمَدَ بْنِ مُحَمَّدٍ عَنِ ابْنِ أَبِي عُمَيْرٍ عَنْ هِشَامِ بْنِ سَالِمٍ عَنْ سُلَيْمَانَ بْنِ خَالِدٍ قَالَ قُلْتُ لأَبِي عَبْدِ الله (عَلَيْهِ الْسَّلام) الرَّجُلُ يَكُونُ فِي قَفْرٍ مِنَ الأرْضِ فِي يَوْمِ غَيْمٍ فَيُصَلِّي لِغَيْرِ الْقِبْلَةِ ثُمَّ يُصْحِي فَيَعْلَمُ أَنَّهُ صَلَّى لِغَيْرِ الْقِبْلَةِ كَيْفَ يَصْنَعُ قَالَ إِنْ كَانَ فِي وَقْتٍ فَلْيُعِدْ صَلاَتَهُ وَإِنْ كَانَ مَضَى الْوَقْتُ فَحَسْبُهُ اجْتِهَادُهُ.

9. Muhammad ibn Yahya has narrated from Ahmad ibn Muhammad from ibn abu ‘Umayr from Hisham ibn Salim from Sulayman ibn Khalid who has said the following: “I once asked abu ‘Abd Allah, ‘Alayhi al-Salam, about a man who is in unpopulated land on a cloudy day and performs Salah (prayer) facing a wrong direction. Clouds then clear and he finds out about his Salah (prayer) having been performed facing a wrong direction. What he must do? He (the Imam) said, ‘If there is still time, he must do his Salah (prayer) again but if the time is passed, then whatever investigation he has done is sufficient.’”