إذا أدْرَكَ أحَدُكُمْ سَجْدَةً مِنْ صَلاةِ العَصْرِ قَبْلَ أنْ تَغْرُبَ الشَّمْسُ فَلْيُتِمَّ صَلاَتَهُ وإذا أدرك سجدة من صلاة الصبح قبل أن تطلع الشمس فليتم صلاته”.
(صحيح) … [خ ن] عن أبي هريرة. الصحيحة 66)
It is reported that Abu Hurayra (may Allah be pleased with him) said:
The Messenger of Allah (peace and blessings of Allaah be upon him) said:
“If anyone of you can get one rak`a of the `Asr prayer before sunset, he should complete his prayer. If any of you can get one rak`a of the Fajr prayer before sunrise, he should complete his prayer.”
This hadith was narrated by al-Bukhari 556 and al-Nasai 1/257.
Sheikh al-Albani called the hadith authentic. See Saheeh al-jami ‘as-saghir 294.
This means that if, in the period of time allotted for the afternoon or any other prayer, a person manages to complete at least one rak’at in full, and then brings his prayer to completion, then it will be valid.