Nafi' (may Allah have mercy on him) says that Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) used to say: The fast belongs only to the one who made the intention to fast before Fajr.
Yunus narrates from al-Zuhri from Sayyiduna Ibn Umar (may Allah be pleased with them both), and in one narration from Salim (may Allah have mercy on him), that Sayyiduna Abdullah and Sayyidah Hafsah (may Allah be pleased with them both) both said this, and the opposite has also been said, as Imam Malik (may Allah have mercy on him) narrated.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصيام / 7910