Sahih al-Bukhari
Sahih al-Bukhari 4492
حَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، حَدَّثَنَا يَحْيَى، عَنْ سُفْيَانَ، حَدَّثَنِي أَبُو إِسْحَاقَ، قَالَ سَمِعْتُ الْبَرَاءَ ـ رضى الله عنه ـ قَالَ صَلَّيْنَا مَعَ النَّبِيِّ صلى الله عليه وسلم نَحْوَ بَيْتِ الْمَقْدِسِ سِتَّةَ عَشَرَ ـ أَوْ سَبْعَةَ عَشَرَ ـ شَهْرًا، ثُمَّ صَرَفَهُ نَحْوَ الْقِبْلَةِ.
Muhammad ibn al-Muthanna related to us: Yahya related to us, from Sufyan: Abu Ishaq related to me, who said: I heard al-Bara (may Allah be pleased with him) say, “We prayed with the Prophet facing Jerusalem for sixteen—or seventeen—months. Then he was turned toward the direction of prayer.”
Translation notes
The source gives the duration as sixteen or seventeen months and says the direction was changed toward the qibla without naming the destination here.