char szTime[32];
CTime time;
time = CTime::GetCurrentTime();
sprintf(szTime, "%4d-%.2d-%.2d %.2d:%.2d:%.2d",
time.GetYear(), time.GetMonth(), time.GetDay(),
time.GetHour(), time.GetMinute(), time.GetSecond());
SetWindowText(szTime);
其中time.GetYear(),time.GetMonth(),time.GetDay(),time.GetHour(), time.GetMinute(), time.GetSecond()返回的都是int型数据