Clock1.systemtime as timestamp in database

I am creating an app using Clock1.systemtime as the key in the firebase database. The date/time is 13 characters long (assume Epoch time + nanoseconds?). When I add other data from an arduino to the database, Epoch time is only 10 characters.


SingleDouble

Can the AI2 app be set to use same timezone as the phone? vs GMT?

I have tried appending 000 to the Epoch time so the keys sort in order but the database am getting odd behavior. Can AI2 app use Epoch time without nanoseconds?

See the date time formats link

How does the Arduino know the time?

The arduino (actually a ESP8266) , connects to Wifi and then is getting epoch time, using NPT Client
I see the dateline formats but the "Call clock1 systemtime" does not accept patterns.

Clock1.Now() returns an Instant, which holds within it a surprising amount of information about your local time zone.

The Clock1.FormatDateTime block can be used to extract time zone information, given the right pattern from the above link.

So the Arduino know the universal time, but how does it know which time zone it's in?

1 Like