All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Your fast is valid. The matter of intention is easy; it is the purpose, and a learned and ignorant person are equal concerning it. If one knows that he will fast tomorrow, then he has intended to fast. Ibn Qudaamah said: “If it occurs to someone at night that tomorrow is Ramadan, and that he is going to fast, then he has made the intention.”
Doubts about an act of worship after its completion are not taken into account. Ibn Rajab said: “If one doubts after completing the prayer or any of the other acts of worship about leaving one of its pillars, then he should not consider this doubt.”
Moreover, Az-Zarkashi said in Al-Manthoor fi Al-Qawaa‘id Al-Fiqhiyyah: “Imaam Ash-Shaafi‘i differentiated between doubt during an act and doubt after an act, and he did not consider it obligatory to repeat the latter, as it causes hardship.” [End of quote]
For more benefit, please refer to Fatwa 119112.
Also, the fact that you do not know whether the fast about which you have doubts was before or after maturity confirms that you are not obliged to make it up, as the presumption is that you are not liable to fast, so if you doubt about reaching maturity at that time, your liability is not affirmed. So we advise you to avoid doubts concerning this and not respond to their initiator (i.e. the devil).
Allaah Knows best.