//int CMyc: : ConvertDateTimeInt (DateTime time)
//{
////double intResult=0;
////DateTime startTime=TimeZone. CurrentTimeZone. ToLocalTime (new DateTime (1970, 1, 1));
////intResult=(time - startTime) TotalSeconds;
////the return (int) intResult;
//}
Results in h a statement is an error
Int ConvertDateTimeInt (DateTime time);
Error 1 error C2061: syntax errors: identifier "DateTime"
What reason?
CodePudding user response:
C # https://docs.microsoft.com/zh-cn/dotnet/api/system.datetime? Redirectedfrom=MSDN& View=netframework 4.8CodePudding user response:
MFC with CTime or COleDateTime GetAsSystemTimeCodePudding user response:
CTime time=CTime: : GetCurrentTime ();Cstrings STR=time. The Format (" M H % : % : % S ");
COleDateTime now=COleDateTime: : GetCurrentTime ();
COleDateTimeSpan span (rand () %, 3650 rand () % 24, rand () % 60, rand () % 60);
Now -=span;
Return now;
CodePudding user response:
2 3 floor is ok