Sahih Muslim 648 f
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
كَيْفَ أَنْتُمْ - أَوْ قَالَ كَيْفَ أَنْتَ - إِذَا بَقِيتَ فِي قَوْمٍ يُؤَخِّرُونَ الصَّلاَةَ عَنْ وَقْتِهَا فَصَلِّ الصَّلاَةَ لِوَقْتِهَا ثُمَّ إِنْ أُقِيمَتِ الصَّلاَةُ فَصَلِّ مَعَهُمْ فَإِنَّهَا زِيَادَةُ خَيْرٍ "
Abu Dharr reported:
(The Messenger of Allah) said: How would you, or how would you, act if you survive to live among people who defer prayer beyond the (prescribed) time? (The narrator said: Allah and His Messenger know best). whereupon he said: Observe prayer at its prescribed time, but if the Iqama is pronounced for (congregational) prayer, then observe prayer along with them. for herein is an excess of virtue.
Full reference and source
Sahih Muslim 648 f In-book : Book 5, Hadith 306 USC-MSA web (English) : Book 4, Hadith 1358 (deprecated)
View source on Sunnah.com (opens in a new tab)