Other Parts Discussed in Thread: MSP430F6736
Hi,
I am trying to proof a product for Y2038 problem, found out that TI compiler as of v20.2.4 still uses 32bit/4byte time_t
The following is test code for mktime():
struct tm calendarTime; calendarTime.tm_year = RTCYEAR - 1970; calendarTime.tm_mon = RTCMON - 1; calendarTime.tm_mday = RTCDAY; calendarTime.tm_hour = RTCHOUR; calendarTime.tm_min = RTCMIN; calendarTime.tm_sec = RTCSEC; time_t seconds = mktime(&calendarTime); uint8_t debugInfo[48]; sprintf(debugInfo, "time_t size = %d, seconds = %010lu", sizeof(time_t), seconds); printDebugInfo(debugInfo, 38); // output to console via UART
I get the following output in console:
2021-04-19 18:52:55, time_t size = 4, seconds = 1618771975 // Unix epoch time since 1970-01-01 00:00:00
As mentioned in another post, time_t can be changed to 64bit for MSP432 series MCU. Can we do this for MSP430 as well?
Thanks.