Share via


CTime::GetAsSystemTime

Call this member function to convert the time information stored in the CTime object to a Win32–compatible SYSTEMTIME structure.

bool GetAsSystemTime(
   SYSTEMTIME& st 
) const throw( );

Parameters

  • timeDest
    A reference to a SYSTEMTIME structure that will hold the converted date/time value of the CTime object.

Return Value

True if successful; otherwise false.

Remarks

GetAsSystemTime stores the resulting time in the referenced timeDest structure. The SYSTEMTIME data structure initialized by this function will have its wMilliseconds member set to zero.

Example

// Convert CTime to FILETIME
CTime time(CTime::GetCurrentTime());
SYSTEMTIME timeDest;
time.GetAsSystemTime(timeDest);
FILETIME fileTime;
::SystemTimeToFileTime(&timeDest, &fileTime);   

Requirements

Header: atltime.h

See Also

Reference

CTime Class

Hierarchy Chart

Other Resources

CTime Members