It was narrated from Hafsah that the Prophet said:
"Whoever does not have the intention of fasting before dawn, then there is no fast for him." (Daif)