Part Number: MSP432P401R
Tool/software: Code Composer Studio
Ok, I've got a complicated routine that shows a potential bug in mktime or perhaps operator error (me), I'm not sure which.
CCS Version: 7.2.0.00013
Here are the steps:
1. I generate unix time locally to my laptop, convert this to ascii string as GM time (by timezone), passed to 432 via usb-to-uart.
note: local to gm time delta is +4 hours (NYT and daylight savings time to GM delta is 4 hours). The string has been verified.
2. the program on the 432 reads the uart decodes string, initializes RTC per the 432 calendar library
3. the laptop then sends a time query comand a a string to the 432 over the uart
4. the query converted to RTC_C_getCalendarTime() that is then converted to a tm data structure
note: the time read from the getCalendar is correct (using the XDS200 to debug)
5. the tm data structure is then passed into mktime, converted to a formatted string by strftime() with forma
"%Y-%m-%dT%H:%M:%S" that is returned to the laptop over the uart.
6. the string returned is consistently off by 6 hours.
As the the hours read from RTC_C_getCalendarTime is correct, evidence points to the mktime() function, and
if I substract 6 from the calender hours before calling mktime(), the conversion when formatted is correct.
Any help?