Abdullah bin Masud reported,

The Messenger of Allah ﷺ said, "You will likely live to see people who pray the prayer outside of its proper time. If you encounter them, then pray in your homes at the time you know to be correct, then pray with them and treat that prayer as a voluntary one."

Ibn Majah 1255

Sahih

حدثنا محمد بن الصباح أنبأنا أبو بكر بن عياش عن عاصم عن زر

عن عبد الله بن مسعود قال

قال رسول الله ﷺ لعلكم ستدركون أقواما يصلون الصلاة لغير وقتها فإن أدركتموهم فصلوا في بيوتكم للوقت الذي تعرفون ثم صلوا معهم واجعلوها سبحة

ابن ماجه 1255صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Establishing prayer and the sunnah regarding it
Chapter
What to do if they delay the prayer beyond its time
Numbering
Darussalam 1255
Ibn Majah 1255