Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) used to say: It is possible that you may meet such people who perform the prayer at an improper time. If you meet them, then perform the prayer at its proper time in your home as you know, then perform the prayer with them as well and make it a voluntary (nafl) prayer.
Hadith Referenceالمنتقى ابن الجارود / كتاب الصلاة / 331
Hadith Gradingغلام مصطفےٰ ظهير امن پوري:إسناده حسن
Hadith Takhrijاز غلام مصطفےٰ ظهير امن پوري:«إسناده حسن : مسند الإمام أحمد : 1/379، سنن ابن ماجه : 1255 ، اس حدیث کو امام ابن خزیمہ رحمہ اللہ (1640) نے صحیح کہا ہے۔»