<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);
格式化输出当前时间
最新推荐文章于 2023-07-10 17:55:31 发布