It is narrated from Sayyiduna Abdullah bin Mas’ud (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: Perhaps you will encounter people who will delay the prayer from its prescribed time; if you do encounter them, then perform the prayer at its proper time in your homes according to your knowledge, then also perform it with them and consider it as a voluntary (nafl) prayer.
Hadith Referenceالفتح الربانی / أبواب صلاة الجماعة / 2528