Praise be to Allah.
It was narrated that Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Allah, may He be glorified and exalted, says: ‘The son of Adam offends Me: he inveighs against time, but I am time; all things are in My hand, I alternate the night and day.” Narrated by al-Bukhaari (4826) and Muslim (2246). According to a report narrated by Muslim: “Do not curse time, for Allah is time.”
Ibn ‘Abd al-Barr (may Allah have mercy on him) said:
As-Shaafa‘i said, explaining that – and Allah knows best: The Arabs used to inveigh against time and blame time when calamities such as death, destruction, loss of wealth and so on befell them, and they would say: “The calamities of time have befallen us” or “Time has destroyed them”, or “Time has finished them off” or “Night and day have done this to them.” So they would blame time for that and inveigh against it.
The Messenger of Allah (blessings and peace of Allah be upon him) said: “Do not curse time” as if it is time that is doing that to you, for if your intention is to inveigh against the one who does that to you, then your inveighing is effectively addressed against Allah, may He be glorified and exalted, for it is He Who does all of that; He is the One Who causes things to happen, for nothing happens except what Allah, the Most High, the Almighty, wills.
End quote from al-Istidhkaar (27/310).
Therefore the reason why it is not allowed to inveigh against time is because what is implied by this inveighing is one of two things:
Either the one who does that believes that time in and of itself has the power to bring benefit or cause harm, in which case he has associated time with Allah, may He be exalted, as a rival to Him in the power to benefit or harm.
Or he believes that time, with all of its joys and sorrows, is something decreed by Allah, may He be exalted, in which case he is effectively inveighing against Allah, may He be glorified and exalted, because it is Allah, may He be exalted, Who is the Creator of all of these things.
Ibn al-Qayyim (may Allah have mercy on him) said:
The one who inveighs against time is inevitably doing one of two things: either he is inveighing against Allah or he is associating something else with Him.
If he believes that time is something that is able to act alongside Allah, then he is a mushrik (one who associates others with Allah), and if he believes that Allah alone is the One Who has done that, then he is inveighing against the One Who did it, so he is inveighing against Allah.
End quote from Zaad al-Ma‘aad (2/324).
Taking this reason into account, the prohibition also includes inveighing against circumstances, because they are decreed by Allah, may He be exalted, and do not possess any power in and of themselves to benefit or harm. Therefore inveighing against them implies that one believes that they themselves have an impact in causing harm, which constitutes shirk or associating others with Allah, may He be exalted, ascribing to circumstances some characteristics of divine Lordship.
Or the one who utters such words believes that these circumstances are something that is controlled and decreed by Allah, may He be exalted, in which case he is criticizing Allah, may He be exalted, for what He does.
In both cases, it is a serious matter that affects the ‘aqeedah (belief) of the Muslim. It is not permissible for a Muslim to do that deliberately, and if he says such a thing by a slip of the tongue, he must hasten to repent from that and declare Allah, may He be exalted, to be far above having any partner or associate, or being thought of as being unjust or unfair.
If a calamity befalls him, he should not inveigh against that which does not deserve that; rather he must adhere to Islamic etiquette by showing patience and remembering Allah, may He be exalted, such as saying Inna Lillaahi wa inna ilayhi raji‘oon (Indeed we belong to Allah, and indeed to Him we will return), as referred to in the following passage (interpretation of the meaning):
“Who, when disaster strikes them, say, ‘Indeed we belong to Allah, and indeed to Him we will return.’
Those are the ones upon whom are blessings from their Lord and mercy. And it is those who are the [rightly] guided”
Or he may say “Qadara Allah wa ma shaa’a fa‘al (Allah has decreed and what He wills He does).”
It was narrated that Abu Hurayrah said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “The strong believer is better and more beloved to Allah than the weak believer, although both are good. Strive to do that which will benefit you and seek the help of Allah, and do not feel helpless. If anything befalls you, do not say ‘If only I had done (such and such), the such and such would have happened,’ rather say: ‘Allah has decreed and what He wills He does,’ for ‘if only’ opens the door to the work of the shaytaan.”
Narrated by Muslim (2664).
And Allah knows best.