Sunan an-Nasa'i, Volume 1, Book 5, Hadith 489 (DarusSalam) ⓘ
It was narrated that Al-Bara' said: "We prayed toward Bait Al-Maqdis (Jerusalem) with the Messenger of Allah for sixteen or seventeen months - Safwan was not sure - then it was changed to the Qiblah."
أَخْبَرَنَا مُحَمَّدُ بْنُ بَشَّارٍ، قَالَ حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ، حَدَّثَنَا سُفْيَانُ، قَالَ حَدَّثَنَا أَبُو إِسْحَاقَ، عَنِ الْبَرَاءِ، قَالَ صَلَّيْنَا مَعَ النَّبِيِّ صلى الله عليه وسلم نَحْوَ بَيْتِ الْمَقْدِسِ سِتَّةَ عَشَرَ شَهْرًا أَوْ سَبْعَةَ عَشَرَ شَهْرًا - شَكَّ سُفْيَانُ - وَصُرِفَ إِلَى الْقِبْلَةِ .
also referenced under: Hadith 488 (Reference) & Book 5, Hadith 41 (In-Book)