COleDateTime tm; // SYSTEMTIME st; CString strTime; //此处的时间格式可以参考MSDN关于ParserDateTime的参数说明 // year, month, day , hour, minute, second为年月日 时分秒(int型) strTime.Format(_T("%d-%d-%d %d:%d:%d"), year, month, day, hour, minute, second ); tm.ParseDateTime(strTime); //转换为COleDtaTime时间 tm.GetAsSystemTime(st); // 获取SYSTEMTIME时间 SetLocalTime(&st);//设置系统时间

评论