Sahih al-Bukhari 3366
صحيح البخاري#3366SahihNarrated Abu Dhar:I said, "O Allah's Messenger (ﷺ)! Which mosque was first built on the surface of the earth?" He said, "Al-Masjid-ul-Haram (in Mecca)." I said, "Which was built next?" He replied, "The mosque of Al-Aqsa (in Jerusalem) ." I said, "What was the period of construction between the two?" He said, "Forty years." He added, "Wherever (you may be, and) the prayer time becomes due, perform the prayer there, for the best thing is to do so (i.e. to offer the prayers in time)
Scholarly Authentication
We show the most cautious grade (weakest-wins) as the overall label. Individual scholars graded it as follows:
Every narration in Sahih al-Bukhari is accepted as Sahih (authentic) by the established status of the book.
In-book reference: 60:40