وَأَخْبَرَنَا مَالِكٌ ، عَنْ يَحْيَى بْنِ سَعِيدِ ، عَنْ سَعِيدِ بْنِ الْمُسَيِّبِ ، أَنَّهُ كَانَ يَقُولُ : " صَلَّى رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ بَعْدَ أَنْ قَدِمَ الْمَدِينَةَ سِتَّةَ عَشَرَ شَهْرًا نَحْوَ بَيْتِ الْمَقْدِسِ , ثُمَّ حُوِّلَتِ الْقِبْلَةُ قَبْلَ بَدْرٍ بِشَهْرَيْنِ " .
Sayyiduna Sa'id bin al-Musayyib (may Allah have mercy on him) used to say that the Messenger of Allah (peace and blessings be upon him) prayed facing Bayt al-Maqdis for sixteen months after coming to Madinah, then two months before the Battle of Badr, the Qiblah was changed.