The STM32F7 is equipped with a real-time clock (RTC), which, when set, will retain the system time as long as the the board has power.

Using

To use Meadow’s RTC module, simply set the time with the SetClock method:

Device.SetClock(new DateTime(
    year: 2021, 
    month: 04, 
    day: 05, 
    hour: 15, 
    minute: 33, 
    second: 25));

Once set, you can use DateTime.Now to retrieve the current local date and time.

DateTime clock = DateTime.Now;

 


These docs are open source. If you find an issue, please file a bug, or send us a pull request. And if you want to contribute, we'd love that too!