網上看到一個函式
//int CMyc::ConvertDateTimeInt(DateTime time)
//{
// //double intResult = 0;
// //DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
// //intResult = (time - startTime).TotalSeconds;
// //return (int)intResult;
//}
結果放在h里一宣告就報錯
int ConvertDateTimeInt(DateTime time);
錯誤 1 error C2061: 語法錯誤: 識別符號“DateTime”
啥原因啊?
uj5u.com熱心網友回復:
C# 的吧 https://docs.microsoft.com/zh-cn/dotnet/api/system.datetime?redirectedfrom=MSDN&view=netframework-4.8uj5u.com熱心網友回復:
MFC 的用 CTime 或 COleDateTime GetAsSystemTimeuj5u.com熱心網友回復:
CTime time = CTime::GetCurrentTime();CString str = time.Format("%H:%M:%S");
COleDateTime now = COleDateTime::GetCurrentTime();
COleDateTimeSpan span(rand() % 3650, rand() % 24, rand() % 60, rand() % 60);
now -= span;
return now;
uj5u.com熱心網友回復:
2樓3樓都可以轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/35256.html
標籤:基礎類
上一篇:作業系統
