- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Tags:
- cts
- LOCAL_TIME_INFO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.