VS2013 #include <stdio.h> #include <ctime> #include <afx.h> void main() { CTime time = CTime::GetCurrentTime(); CString time_cs = time.Format(_T("%Y-%m-%d %H:%M:%S")); printf(time_cs.GetBuffer()); getchar(); } Caesar卢尚宇 2020年12月12日