If one rakat of a salah has been offered before its time ends, Prophet Muhammad has directed that the salah should be completed and it shall be considered as being offered on time.
Consequently, it has been narrated that he said that a person who offers one rakat of fajr before sunrise and one rakat of asr before sunset, he should rest assured that these prayers have been offered on time. [Al-Bukhari, Al-Jami‘ al-sahih, 245-246, (no. 1374); Muslim, Al-Jami‘ al-sahih, 234-236, (no. 1930)]
He (SWS) is also reported to have said that if a person sleeps, then it is not his fault if he misses the salah; however, if a person leaves a salah while being awake, then he is certainly at fault. Therefore, if anyone forgets to offer the salah or is asleep at the time of salah, he should offer it as soon as he realizes it. [Al-Bukhari, Al-Jami‘ al-sahih, 99, (no. 597); Muslim, Al-Jami‘ al-sahih, 276-278, (nos. 1562, 1566); Al-Nasa’i, Sunan, 84, (no. 616)]