Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Interpretation of utc_offset field

Rank

Total Posts: 9

Joined 2008-10-25

PM

I need to determine local midnight based on user timezone. My initial interpretation of the utc_offset field in the device_settings message was that it would be used for timezone differences. However, re-reading the comment:

"Offset from system time. Required to convert timestamp from system time to UTC."

suggests that interpretation may be incorrect.

If I'm keeping UTC in my timestamps, is using the utc_offset to derive local time acceptable use?

And in either case, am I correct that the units is seconds?      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Utc_offset is a constant that may be used to convert date_times that represent system time (ie are < 0x10000000) into timestamps that represent UTC time.

On those occasions when the device has started but the time hasn’t been set yet, time is maintained as “system time” (secs since reset), then when the UTC time is initialized the device computes the offset so that previous records may be used.

So yes it is in seconds but you can’t use it to determine the local time.