Home > Software engineering >  Vc2013 how to convert a DateTime data for a UTC time integer?
Vc2013 how to convert a DateTime data for a UTC time integer?

Time:11-25

Online to see a function
//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.8

CodePudding user response:

MFC with CTime or COleDateTime GetAsSystemTime


CodePudding 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
  • Related