Export (0) Print
Expand All


Gets a struct tm that contains a decomposition of the time contained in this CTime object.

struct tm* GetGmtTm( 
   struct tm* ptm  
) const;


Points to a buffer that will receive the time data. If this pointer is NULL, an exception is thrown.

A pointer to a filled-in struct tm as defined in the include file TIME.H. See gmtime, _gmtime32, _gmtime64 for the structure layout.

GetGmtTm returns UTC.

ptm cannot be NULL. If you want to revert to the old behavior, in which ptm could be NULL to indicate that an internal, statically allocated buffer should be used, then undefine _SECURE_ATL.

// Compute difference between local time and GMT
CTime time(CTime::GetCurrentTime());
tm t1, t2;

ATLTRACE(_T("Difference between local time and GMT is %d hours.\n"), 
   t1.tm_hour - t2.tm_hour);   

Header: atltime.h

Community Additions

© 2015 Microsoft