Hello,
I have a project based on a STM32 using the internal RTC.
I was using the toolchain “arm-eabi-gcc7.2.0-r3” to translate a timestamp UNIX to a tm struct and sthen set my RTC like this :
#include
#include <sys\time.h>
void RTC_SetTimeByTimeStamp(uint32_t u32_TimeStamp)
{
struct tm* p_time;
/* convert into unix time struct */
p_time = gmtime((time_t*)&u32_TimeStamp);
...
}
All was OK. If I call this function with a timestamp at 1576158671, the p_time struct contain :
12/12/2019 13:51:11
But with the latset toolchain “arm-eabi-gcc9.2.1”, the same function, call with the same timestamp value set the p_time struct with random value like :
2/1/1971721 11:25:06
Thanks for your help.
-
This topic was modified 4 years, 10 months ago by support. Reason: formatting