ChrisTenone:
None-the-less, in Arduino terminology, there is a difference between Flash and EEPROM. If the OP hasn't bothered to learn the difference between the terms (or to have responded to any of the replies) then why should we put in any more effort to help them?
Cumbrut ... really?
The OP never indicated he had any confusion regarding flash/eeprom, it's arduinoaleman who posted using incorrect terminology.
arduinoaleman:
Did it really work perfectly for a while?
If YES, you might have a hardware problem.
The code you uploaded is stored in EEPROM. Just reinstall your code.
It does not happen that often, but bits in EEPROM might not be stable for several reasons.
This is very rare. Just show us your code.
And YES, you can trust the millis-function.
The code is stored in Flash, aka "program memory".
There is also a form of non-volatile memory on the chip called EEPROM (you can read from and write to it from within your sketch, for example to save settings).
Neither of them lose data under normal operation - they should keep their data for decades, barring abuse.
While the underlying technology is similar, the way they are used is very different, so care should be taken to use the correct terminology.
Millis can be trusted, but only as far as you can trust the system clock. Which unfortunately is a resonator only accurate to within a percent or two on most arduino boards. Use an RTC if you want more accurate time.
That all said - it's not exactly clear what the problem you're having is - it would be best to post your code and a more detailed description of what it's doing, and how that differs from your expectation.