The Messenger of Allah ﷺ struck my thigh and said: How would you act if you survive among the people who would delay prayers beyond their (prescribed) time? He (Abu Dharr) said: What do you command (under this situation)? He (the Holy Prophet) slid: Observe prayer at its prescribed time, then go (to meet) your needs, and if the Iqama is pronounced, and you are present in the mosque, then observe prayer (along with the Jama'at). (Using translation from Muslim 648d)
قَالَ لِي رَسُولُ اللهِ ﷺ وَضَرَبَ فَخِذِي «كَيْفَ أَنْتَ إِذَا بَقِيَتَ فِي قَوْمٍ يُؤَخِّرُونَ الصَّلَاةَ عَنْ وَقْتِهَا؟» قُلْتُ مَا تَأْمُرُ؟ قَالَ «صَلِّ الصَّلَاةَ لِوَقْتِهَا ثُمَّ اذْهَبْ لِحَاجَتِكَ فَإِنْ أُقِيمَتِ الصَّلَاةُ وَأَنْتَ فِي مَسْجِدٍ فَصَلِّ»