1.CTime对象转换为DWORD类型
CTime time=CTime::GetCurrentTime(); //获取当前时间
DWORD timedw = time.GetTime(); //CTime->DWORD
2.DWORD类型变量转换为CTime对象
CTime time1(timedw); //DWORD->CTime
CString strTime;
strTime.Format( "%d-%d-%d %d:%d:%d",
time1.GetYear(),time1.GetMonth(),time1.GetDay(),time1.GetHour(),time.GetMinute(),time.GetSecond()); //CTime的格式化显示
延伸阅读