Will Time.local() still give accurate timing despite Cellular Disconnection?

I am using Electron, my application need to publish event with time stamp of real local time, this mean with time zone and Daylight Saving Time (DST) consideration.

It seems Time.local() would take care of it, reading from the docs https://docs.particle.io/reference/device-os/firmware/electron/#local-

But this is my question, say in the beginning we already connected to Cellular Network, then query the time zone with DST adjustment via AT command and use the value to set time zone accordingly. But then, for some reason we have cellular disconnection; at this state will the call to API Time.local() give accurate real local time?

1 Like

Yes, the RTC will keep updating the clock even without cell connection.
Although there will be some drift in the range of ~1sec per day.

Thank you @ScruffR, is the drift due to disconnection and will be back to normal once connection resumed?

Do you have any recommendation to address the drift?

Nope, the drift comes from the same source as any of your conventional clocks and watches drift over time - slight deviation in production, supply voltage, ambient factors (temperature, humidity, …)
If there were cost effective ways to produce 100% accurate, small, free running clocks there would not be any need to invest millions in atomic clocks :wink:

Even without a loss of connection the free running RTC will drift over time and calls for a Particle.syncTime() every few days. On the other hand, when the connection actually gets lost and then regained that will implicitly perform a sync.

Got it, in that case, I can live with that :slight_smile:, thank you!

1 Like