<pre name="code" class="cpp"> time_t tNow = 0;
struct tm tmTemp = {0};
char szTime[32];
tNow = time(NULL);
gmtime_r(&tNow, &tmTemp);
(VOID)strftime(szTime, 31, "%Y-%m-%d %H:%M:%S", &tmTemp);
<pre name="code" class="cpp"> time_t tNow = 0;
struct tm tmTemp = {0};
char szTime[32];
tNow = time(NULL);
gmtime_r(&tNow, &tmTemp);
(VOID)strftime(szTime, 31, "%Y-%m-%d %H:%M:%S", &tmTemp);