#include <iostream>
#include <time.h>
using namespace std;
int main()
{
time_t t = time(0);
char tmp[64];
strftime(tmp, sizeof(tmp), "%Y/%m/%d/%X %A", localtime(&t));
cout << tmp << endl;
return 0;
}
#include <iostream>
#include <time.h>
using namespace std;
int main()
{
time_t t = time(0);
char tmp[64];
strftime(tmp, sizeof(tmp), "%Y/%m/%d/%X %A", localtime(&t));
cout << tmp << endl;
return 0;
}
本文标题:C++获取本地时间
本文链接:https://www.haomeiwen.com/subject/qrdysxtx.html
网友评论