Main Site Documentation

Deprecation of RealTimeClock.IsTimeValid method



The latest release notes (SDK Version 1.0.11 October 15, 2010) assert “[italic]Note: RealTimeClock.IsTimeValid, in certain situations, does not perform as expected. It is no longer supported and always returns false. Please see RealTimeClock class for alternatives[/italic]”.

I’ve checked the RealTimeClock class for viable alternatives - it only supports [italic]GetTime, SetTime & SetAlarm[/italic] methods.

Any proposals for alternative techniques?




I just check to see if the time is less them something like 12/1/2010 (if it is not set correctly or resets, it is something like 1/1/2009, can’t remember exactly). If it is less then whatever date I put in there that I KNOW is in the past AND I have set it already, then I know I have an issue and need to reset the clock. Also, note that the Utility date and time resets to a much early date (2001?) and you always need to set it to the current RTC time on startup.


The only way to check is by validating that time is something reasonable


I fixed that by checking if some value in the battery-powered memory is equal to my magic value. If it is, the time is probably accurate as well. If not, it ask the user to set the date/time and write my magic value (e.g. ‘1234’)


Yes. These suggestions are mentioned in the documentation: