#include <stdio.h>
#include <time.h>
std::string getCurrentTimeStr(){
time_t t = time(NULL);
char ch[64] = {0};
char result[100] = {0};
strftime(ch, sizeof(ch) - 1, "%Y%m%d--%H%M%S", localtime(&t));
sprintf(result, "%s", ch);
return std::string(result);
}
ubuntu C++ 获取当前系统时间
最新推荐文章于 2023-04-17 18:24:16 发布