#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
time_t curtime;
time(&curtime);
tm* nowtime = localtime(&curtime);
cout << 1900 + nowtime->tm_year << "年" << 1 + nowtime->tm_mon << "月" << nowtime->tm_mday << "日" << endl;
cout << "时间: " << nowtime->tm_hour << ":" << nowtime->tm_min << ":" << nowtime->tm_sec << endl;
return 0;
}
运行之后会出现系统当前时间