in order to fully understand a hadith we must not only rely on the literal translation in english, as it can sometimes not convey the intented meaning. this is why there are tafsir(commentary) books written on major works of hadith.
this hadith in NO way can be interpreted as there is a time window for repentance. (keeping in mind your literal understanding of this hadith). Allah the mighty and sublime is limitless, thinking that our repentance is accepted only during certian times is limiting the ability of your creator, subahaanallah!. may Allah protect you and me from such thoughts.
ill try to clarify a little more on this subject in light of quran and sunnah so that you might understand better, insha Allah.
One should never lose hope in the mercy of Allah Ta’ala. Allah Ta’ala mentions:
“Say, O My slaves who have transgressed against their souls, do not despair of the mercy of Allah. Truly Allah forgives all sins. Undoubtedly, He is the Most Forgiving, the Most Merciful”
(Surah Zumar, Verse: 53)
In Surah Al Baqarah, Allah Ta’ala mentions:
“Allah loves those who constantly repent and He loves those who purify themselves”
(Surah Baqarah, Verse: 222)
- In Surah An Nisa, Allah Ta’ala says:
“Whoever commits a sin or wrongs himself and then seeks Allah’s forgiveness will find Allah Most Forgiving, Most Merciful”
(Surah An Nisa, Verse: 110)
there are many verses about repentance/mercy in quran and the only time limit mentioned for the accpetance of repentance is when the sun rises from the west. (we must understand that sun rising from the west/judgement day/arrival of the hour are all used in english in the same meaning). the following is the verse which scholars define the last moment for repentance,
Do they [then] wait for anything except that the angels should come to them or your Lord should come or that there come some of the signs of your Lord? The Day that some of the signs of your Lord will come no soul will benefit from its faith as long as it had not believed before or had earned through its faith some good. Say, "Wait. Indeed, we [also] are waiting." [6:158]
this verse is referring to the sun rising from the west according to the majority of the commentators. [imam tabari/ibn kathir]
Imam Tabari, after mentioning the different opinions of the commentators writes, "The most correct opinion in regards to the meaning of this verse is that what is apparent from the reports narrated from the Prophet that he said, "(lmaan will be of no benefit) when the sun rises from the west." (Tabari)
from the above we can see that Allah is the most merciful and He has given us time till the very last moment to repent and turn to Him.
let us look at this in the light of authentic sunnah now, insha Allah. these ahadith will give us hope despite our persistence upon sinning.
- Sayyiduna Abu Hurayrah (radiyallahu ‘anhu) reports that Nabi (sallallahu ‘alayhi wa sallam) [reported a Hadith Qudsi, Allah Ta’ala said]:
“A servant of Allah committed a sin and said, ‘O Rabb, I have sinned, so forgive me!’ His Rabb said, ‘Does My slave acknowledge that he has a Rabb who forgives sins and also punishes/takes to task for it? I have forgiven My slave.’
Then he remained for [some time] as long as Allah wished and then again committed a wrong sin and said, ‘O Rabb, I have sinned again, forgive the sin.’ Allah Ta’ala said, ‘Does My slave acknowledge that he has a Rabb who forgives wrong action and punishes for it? I have forgiven My slave.’
Then he remained for [some time] as long as Allah wished and then committed a sin and said, ‘O Rabb, I have committed another wrong action, so forgive me.’ Allah Ta’ala said, ‘Does My slave acknowledge that he has a Rabb who forgives wrong action and punishes for it? I have forgiven My slave,’ three times ‘so let him do what he likes.” [i.e. let him continue asking for forgiveness and making a firm intention of abandoning that vice each time he slips up]
(Sahih Bukhari, Hadith: 7507, Sahih Muslim, Hadith: 2758 with difference in the wording. Refer: Targhib, vol. 4 pg. 91)
- Sayyiduna Anas ibn Malik (radiyallahu ‘anhu) reports that Nabi (sallallahu ‘alayhi wa sallam) said:
“Allah Ta’ala says, ‘O Son of Adam, so long as you call upon Me and have hope in Me, I shall forgive you for whatever you have done and I shall not mind. O son of Adam, if your sins were to reach the clouds of the sky and then you were to ask forgiveness of Me, I would forgive you and I shall not mind. O son of Adam, if you were to come to Me with an earthful of sins and were you then to face Me, without having ascribing any partner to Me, I would grant you an earthful of forgiveness”
(Sunan Tirmidhi, Hadith: 3540. Declared sound –hasanun gharib– by Imam Tirmidhi. Some editions of Sunan Tirmidhi have the word ‘gharib’ only)
- Sayyiduna Abu Hurayrah (radiyallahu ‘anhu) reports that Rasulullah (sallallahu ‘alayhi wa sallam) said:
“If you were to commit so many sins that they reach the sky and then you were to repent, your repentance would be accepted.”
(Sunan Ibn Majah, Hadith: 4248. ‘Allamah Mundhiri (rahimahullah) has declared the chain authentic –jayyid-, Targhib, vol. 4 pg. 90/91)
the mercy of Allah the mighty and sublime is endless, if we fulfill the criteria of a sincere repentance then it will be accepted regardless of the time you have done it, insha Allah.
i believe it is worthy to mention this hadith qudsi so that it might give you a more clear understanding and a firmer faith.
On the authority of Abu Hurayrah (may Allah be pleased with him), who said that the Prophet (ﷺ) said:
"Allah the Almighty said: I am as My servant thinks I am" and in another possible rendering of the Arabic is: "I am as My servant expects Me to be".
[Reference: Hadith 15, 40 Hadith Qudsi]
the meaning is that forgiveness and acceptance of repentance by the Almighty is subject to His servant truly believing that He is forgiving and merciful. however, not to accompany such belief with right action would be to mock the Almighty. It was related by al-Buhkari (also by Muslim, at-Tirmidhi and Ibn-Majah).
thinking positively of Allah, may He be exalted, is a great act of worship of the heart. do not lose hope and let the shaithaan create doubts in your thoughts, always be mindful of Allah.
may Allah grant you mercy and guide you to the straight path.
Allah knows best.