获取当前时间并格式化,CTime类

CTime类,此类应该不是C++标准类库,属于windows封装的关于时间的类库,使用环境应该为 Win32程序,MFC程序,VC++程序

CTime tm = CTime::GetCurrentTime();
CString time = tm.Format(_T("%Y%m%d"));

获取当前时间,并且进行格式化操作,转换为CString类型

原文地址:https://www.cnblogs.com/fudong071234/p/6400669.html