废话不多说直接上代码!
#include<iostream>
#include<atltime.h>
using namespace std;
int main()
{
CTime time = CTime::GetCurrentTime();
CString date = time.Format(_T("%Y-%m-%d %X"));
wcout << date.GetString() << endl;
system("pause");
}
#include<iostream>
#include<atltime.h>
using namespace std;
int main()
{
CTime time = CTime::GetCurrentTime();
CString date = time.Format(_T("%Y-%m-%d %X"));
wcout << date.GetString() << endl;
system("pause");
}