This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: Time library problem

Part Number: MSP432E401Y


Hello,

I am using MSP432E401Y controller and try to build time library function.

    struct tm ltm;
    memset(&ltm, 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(&ltm);

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