Tool/software: Code Composer Studio
Hi,
I have a problem with the localtime function, until 02/28/2020 it decode the UNIX time correct. But after the date 02/29/2020 (leap day)
it adds one day.
UNIXTime=1583020740 (02/29/2020 @ 11:59pm) converting with localtime() gives 01-03-20 23:59:00 (UTC)
UNIXTime=1614605651 (03/01/2021 @ 1:34pm) converting with localtime() gives 02-03-20 23:59:00 (UTC)
The code is:
UNIXTime=1582934340; // 02/28/2020 @ 11:59pm (UTC)
Ur1_Minutes=NTPinfo->tm_min;
Ur1_Hours=NTPinfo->tm_hour;
Ur1_Date=NTPinfo->tm_mday;
Ur1_Month=NTPinfo->tm_mon+1;
Ur1_Years=NTPinfo->tm_year-30;