حَدَّثَنَا مُحَمَّدُ بْنُ الصَّبَّاحِ، أَنْبَأَنَا أَبُو بَكْرِ بْنُ عَيَّاشٍ، عَنْ عَاصِمٍ، عَنْ زِرٍّ، عَنْ عَبْدِ اللَّهِ بْنِ مَسْعُودٍ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ ‏"‏ لَعَلَّكُمْ سَتُدْرِكُونَ أَقْوَامًا يُصَلُّونَ الصَّلاَةَ لِغَيْرِ وَقْتِهَا. فَإِنْ أَدْرَكْتُمُوهُمْ فَصَلُّوا فِي بُيُوتِكُمْ لِلْوَقْتِ الَّذِي تَعْرِفُونَ. ثُمَّ صَلُّوا مَعَهُمْ وَاجْعَلُوهَا سُبْحَةً ‏"‏ ‏.‏
Translation
It wasnarrated from Abu Dharr that the Prophet (ﷺ) said

“Offerprayeron time, and if you reached the Imam leading them in prayers(ontime), then perform it with them, and you will be safe with yourprayer, otherwise it will be voluntary for you.”