The Messenger of Allah ﷺ said to me, "Abu Dharr, there will come over you rulers who delay the prayer past its proper time. If you live to see them, perform the prayer at its proper time," and he may have said, "in your dwelling, then come to them. If you find that they have already prayed, you will have prayed, and if you find that they have not yet prayed, you will pray with them, and it will count for you as a voluntary prayer."
حدثنا إسماعيل حدثنا صالح بن رستم عن أبي عمران الجوني عن عبد الله بن صامت
قال لي رسول الله ﷺ يا أبا ذر إنه سيكون عليكم أمراء يؤخرون الصلاة عن مواقيتها فإن أنت أدركتهم فصل الصلاة لوقتها وربما قال في رحلك ثم ائتهم فإن وجدتهم قد صلوا كنت قد صليت وإن وجدتهم لم يصلوا صليت معهم فتكون لك نافلة
Its isnad is sahih. Salih bin Rustum is Muzani, whom Abu Dawud, Ajli, and Ibn Hibban deemed reliable, and Ibn Main and Ahmad graded him sahih, while Abu Hatim found fault with him. His hadith appears in Muslim, and the hadith has already appeared at 21370.