Thread 中讨论的其他器件:SYSBIOS
工具/软件:TI-RTOS
大家好、
请参阅以下代码。
#include
#include
struct tm* timebuffer;
Seconds_set (1552641654);
步骤1:
代码:
TIME_t 当前时间=时间(空);
timeBuffer = localtime (&currTime);
char* curTime = asctime (timebuffer);
System_printf ("以前的时间(GMT):%s\n"、curTime);
system_flush();
输出:
之前时间(GMT):2019年3月15日、星期五、09:20:55
步骤2:
代码:
seconds_getTime (&ts);
struct tm* currTime = localtime (&ts.secs);
CHAR* CTime =上升时间(当前时间);
System_printf ("下班时间(GMT):%s\n"、CTime);
system_flush();
输出:
下班时间(GMT):1949年3月15日09:20:55
如果我使用的是 Step2、我将获得70年的差异。
能不能有人能解决我的问题、我如何同时以两种方式获得。
提前感谢。
需要快速回复。