The Messenger of Allah ﷺ said, "Abu Dharr, pray each prayer at its appointed time. If you come to the people and they have already prayed, you will have secured your prayer. And if they have not yet prayed, pray with them, and it will count as an extra prayer for you."
حدثنا مرحوم بن عبد العزيز العطار حدثني أبو عمران الجوني عن عبد الله بن الصامت
قال رسول الله ﷺ يا أبا ذر صل الصلاة لوقتها فإن أتيت الناس وقد صلوا كنت قد أحرزت صلاتك وإن لم يكونوا صلوا صليت معهم وكانت لك نافلة