All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Keeping the date of the fast day in mind is not a condition for the validity of the fast, whether it be in Ramadhaan or in other months. Rather, it is not required at all as far as we know. When someone observes an obligatory fasting, it is enough for him to have the intention of fasting at any part of the previous night. It is enough if it crosses his mind during the night that he will be fasting tomorrow. Al-Mardaawi said, "If it crossed a person's mind at night that he will be fasting tomorrow, then he has properly formed the intention of fasting." [Al-Insaaf]
Shaykh Al-Islam Ibn Taymiyyah said, "The same applies to the intention of fasting in Ramadhaan; it is not obligatory on anyone to say, 'I am fasting tomorrow,' according to the consensus of leading scholars; rather, it is sufficient to have the intention in his heart." [Majmooʻ Al-Fataawa]
What the questioner used to do of keeping the Hijri date in mind when fasting does not invalidate the fast; nevertheless, it is not required and was not practiced by the early Muslim generations.
Allah knows best.