c++mfctime.h

What is the use of _time64_t in MFC


Can someone explain to me what is _time34_t ? How will I use it ? I don't know how this _time64_t works. Should I use it as:

CTime::GetCurrentTime(_time34_t);


Solution

  • There is no _time64_t in ATL or MFC. There is __time64_t (two leading underscores). That, however, is part of the (Universal) CRT, and not part of ATL or MFC either.

    __time64_t is defined in corecrt.h as follows:

    typedef __int64 __time64_t;
    

    In other words: a 64-bit signed integer type. Values of this type are commonly interpreted to hold the number of seconds elapsed since midnight, January 1, 1970 (also known as UNIX time). It is returned e.g. by the _time64 function.

    For ATL/MFC projects you can use CTime for time and timespan calculations, although you should consider using C++' std::chrono instead. It's just an all around better alternative, easier to use, more robust, and works well with timezones and calendars.