Hello,
I am using MSP432E401Y controller and try to build time library function.
struct tm ltm;
memset(<m, 0, sizeof(struct tm));
ltm.tm_year = 2022 - EPOCH_YEAR; //EPOCH_YEAR = 1970
ltm.tm_mon = 0;
ltm.tm_mday = 2;
ltm.tm_hour = 1;
ltm.tm_min = 1;
ltm.tm_sec = 1;
ltm.tm_wday = 0;
// Convert to number of seconds, this will also fill up tm_wday and tm_yday
struct timespec tspec;
tspec.tv_nsec = 0;
tspec.tv_sec = mktime(<m);
After code execution I got value is tspec.tv_sec=1640998861sec. but according to epoch time converter its value should be 1641085261 sec.
I find that it 86400sec less then actual time.
I can not able to find problem.
Thanks,
Dinkar