Reference: http://www.alfawzan.af.org.sa/node/14745
Question: Is it necessary to make the intention the night before to fast a voluntary fast [the following day]?
Response: No, it is not necessary. [Regarding] voluntary fasts, it is permissible to make the intention during the day [of the fast] – with the [strict] condition that he has not eaten nor drunk [anything] since after [the time of] Fajr. So when the day has started, and [he is sure] he has not eaten nor drunk anything since after [the time of] Fajr – and thereafter made the intention to fast the voluntary fast [at any time] before zawaal (sun at highest point – leaving no shadow), then there is no problem with that; [as] the Prophet ﷺ also did that.