我想在代码中使用 mm/dd/yy 格式的系统日期/时间。但问题是我得到的时间不是吃/时间格式。所以我想把它改成CTime格式,这样我就可以使用了。这怎么可能? 如何将 CString 转换为 CTIme 格式?
问候,
莫涵
最佳答案
您的问题示例如下:
COleDateTime myDtTime;
CTime sysTime;
if(myDtTime.ParseDateTime(strTimestampOther))
{
SYSTEMTIME st;
if(myDtTime.GetAsSystemTime(st))
{
sysTime = st;
}
}
else
ASSERT(FALSE);
关于c++ - 如何在 C++ 中将 CString 转换为 CTime?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5482593/