Hello,
I'm working on a type of activity tracker using the NRF52, and I'm a bit stuck with time aspects.
The device stores two versions of activity data; daily totals, and 60 second summaries.
The daily totals need to be reset at local midnight, so every time the device connects to its app I pass across the number of seconds currently into the day based on the phones local time. So if it's 6 pm, this is set as 64,000. Then every time a timer increases the value I check if it's over 86,400 (midnight) and if so reset the time and all the totals.
For the 60 second summaries, which are stored in flash for later remote analysis, I include a time stamp of UTC time (seconds since epoch) and the number of minutes offset for the local timezone, from the user's phone.
I was wondering if anyone could suggest a better scheme, or if this sounds reasonable?
Thanks.