Messenger of Allah ﷺ said, "Whoever could get one rakʿa (of the Fajr prayer) before sunrise, he has got the (morning) prayer and whoever could get one rakʿa of the ʿAsr prayer before sunset, he has got the (ʿAsr) prayer."
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ مَنْ أَدْرَكَ مِنَ الصُّبْحِ رَكْعَةً قَبْلَ أَنْ تَطْلُعَ الشَّمْسُ فَقَدْ أَدْرَكَ الصُّبْحَ وَمَنْ أَدْرَكَ رَكْعَةً مِنَ الْعَصْرِ قَبْلَ أَنْ تَغْرُبَ الشَّمْسُ فَقَدْ أَدْرَكَ الْعَصْرَ