#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
int main()
{
time_t timep;
time(&timep);
char tmp[64];
strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S", localtime(&timep));
cout << "currentTime is " << tmp << "." << endl;
return 0;
}
C++如何在打印输出时加上时间戳
最新推荐文章于 2024-04-29 10:02:37 发布