The evidence for this is that the Prophet ﷺ once entered upon his family and said: “Do you have anything?” They replied, “No.” He said, “Then I am fasting.” (1)
The word “then” in the hadith refers to the present time; thus, he formed the intention during the day. This indicates that it is permissible to form the intention for a voluntary fast during the course of the day. If someone were to object, saying: “We may dispute what this hadith indicates and say that the meaning of ‘Then I am fasting’ is merely, ‘I am abstaining from food.’ Who says that fasting here means the legally prescribed fast?”
We reply: We have an established legal-theoretical principle: unrestricted speech is understood according to its actual meaning in the convention of the one who uttered it. The legal meaning of fasting is worshipping Allah by abstaining from that which breaks the fast, from the break of dawn until sunset. Therefore, it is not possible to interpret a word spoken by the Lawgiver according to its merely linguistic meaning when it has an established legal meaning.
Yes, if we were to assume that there were no established legal meaning, it would be understood according to its linguistic meaning. But when a legal meaning exists, it must be understood accordingly. Thus, if someone says, “By Allah, I will not sell anything today,” and then goes and sells wine, must he offer expiation for an oath? We say: He is not required to offer expiation, because this sale is not a legally valid sale; rather, it is unlawful. Every condition not found in the Book of Allah is invalid, and every contract not found in the Book of Allah is invalid.
However, if he says, “By ‘sale,’ I intended any sale whatsoever, whether legally valid or not,” then we say that this does indeed count as a sale, and he has broken his oath, because intention takes precedence over the indication of the wording in matters of oaths.