Narrated Abu Dharr (may Allah be pleased with him): I asked, "O Messenger of Allah! Which mosque was built first on the earth?" He (peace be upon him) replied, "Al-Masjid al-Haram." Then I asked, "Which one next?" He (peace be upon him) replied, "Al-Masjid al-Aqsa (Bayt al-Maqdis)." I asked again, "What was the period between the two?" He (peace be upon him) replied, "Forty years." (This period was probably mentioned with reference to the first construction, i.e., during the time of Adam, peace be upon him, because there is more than a thousand years between Prophet Ibrahim, peace be upon him, and Prophet Sulaiman, peace be upon him.) Then he (peace be upon him) said, "Wherever you are when the time for prayer comes, pray there. Indeed, there is great virtue in performing the prayer at its time."