Interpreting CTS Local Time Information

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MikeAustin
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

I have some code that is reading the CURRENT_TIME and LOCAL_TIME_INFO from a CTS.  The CURRENT_TIME information is coming through in a format I can interpret and then transfer into my RTC, but the LOCAL_TIME_INFO isn't quite what I was expecting.

I am in the UTC+10 timezone, and we are currently on DST, so are effectively UTC+11.  When I read the .timeZone and .dst information from the CTS, I get:

.timeZone = 40

.dst = 4

This is the code snippet I am using to read the LOCAL_TIME_INFO in my CTS Call Back function:

else if(timeAttribute->charIndex == CYBLE_CTS_LOCAL_TIME_INFO)
{
/* copy the local time info received from the time server to local data structure for RTC operation */
timeValue = timeAttribute->value;
memcpy(&localTimeInfo, timeValue->val, timeValue->len);

#ifdef DEBUG_RTC
   WriteREM("Time Zone : %d, DST : %d\r\n", localTimeInfo.timeZone, localTimeInfo.dst);
#endif

timeSet = TRUE;
}

Should I be expecting .timeZone = 10 & .dst = 1?  Or is there some further formatting I need to do on the LOCAL_TIME_INFO to get the correct information, so I can adjust the local time to UTC time

Thanks,

Mike

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

Please refer to the attached images for the time zone char. From the image, <Enumeration key="40" is value="UTC+10:00" />

For DST value, please refer to this link<Enumeration key="4" is value="Daylight Time (+1h)" />

Thanks,
P Yugandhar.

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

Please refer to the attached images for the time zone char. From the image, <Enumeration key="40" is value="UTC+10:00" />

For DST value, please refer to this link<Enumeration key="4" is value="Daylight Time (+1h)" />

Thanks,
P Yugandhar.

0 Likes