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.

RTOS/TM4C1294KCPDT: System epoch time is getting wrong

Part Number: TM4C1294KCPDT
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi Everyone,

Please refer below code.

#include <ti/sysbios/interfaces/ISeconds.h>
#include <ti/sysbios/hal/Seconds.h>

struct tm* timeBuffer;

Seconds_set(1552641654);

STEP1:
Code:
time_t currTime = time(NULL);
timeBuffer = localtime(&currTime);
char* curTime = asctime(timeBuffer);
System_printf("Previous Time(GMT): %s\n", curTime);
System_flush();

Output:
Previous Time(GMT): Fri Mar 15 09:20:55 2019


STEP2:
Code:
Seconds_getTime(&ts);
struct tm* currTime = localtime(&ts.secs);
char* cTime = asctime(currTime);
System_printf("After Time(GMT): %s\n", cTime);
System_flush();

Output:
After Time(GMT): Tue Mar 15 09:20:55 1949

If i am using Step2 i am getting 70 years difference.

Can anyone please resolve my issue how can i get in both ways same time.

Thanks in advance.

Expecting a quick reply.