标签:main har mic 获取 sizeof print bsp 图片 %s
time.h 格式化日期
time()获取当前日期的秒,localtime()获取当前时间字段, strftime格式化日期到字符串
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <pthread.h> #include <time.h> int main() { time_t rawtime; struct tm *timeInfo = NULL; char buff[80]; time(&rawtime); printf("rawtime:%d\n", rawtime); timeInfo = localtime(&rawtime); strftime(buff, sizeof(buff),"%Y-%m-%d %H:%M:%S", timeInfo); printf("buff:%s\n", buff); return 0; }
标签:main har mic 获取 sizeof print bsp 图片 %s
原文地址:https://www.cnblogs.com/luckygxf/p/12508201.html