CTime::GetTimeSee Also CTime Overview | Class Members | Hierarchy Chart | CTime::CTime Returns a __time64_t value for the given CTime object.__time64_t GetTime( ) const throw( ); Return Value GetTime will return the number of seconds between the current CTime object and January 1, 1970.Example // Example for CTime::GetTime CTime t( 1999, 10, 20, 23, 50, 0 ); // 11:50 PM October 20, 1999 time_t osBinaryTime = t.GetTime(); // time_t defined in <time.h> printf( "time_t = %ld\n", osBinaryTime );
memset(&tm, 0, sizeof(tm));
tm.tm_year = 77;
tm.tm_mon = 12;
tm.tm_mday = 12;
tm.tm_hour = 12;
tm.tm_min = 15;
tm.tm_sec = 30;time_t t = mktime(&tm);
time_t osBinaryTime = t.GetTime(); // time_t defined in <time.h>
printf( "time_t = %ld\n", osBinaryTime );
osBinaryTime就是从1970年1月1日0:0:0秒到1977年12月12日12点15分30秒的秒数
1970年1月1日8:0:0
CTime Overview | Class Members | Hierarchy Chart | CTime::CTime
Returns a __time64_t value for the given CTime object.__time64_t GetTime( ) const throw( );
Return Value
GetTime will return the number of seconds between the current CTime object and January 1, 1970.Example
// Example for CTime::GetTime
CTime t( 1999, 10, 20, 23, 50, 0 ); // 11:50 PM October 20, 1999
time_t osBinaryTime = t.GetTime(); // time_t defined in <time.h>
printf( "time_t = %ld\n", osBinaryTime );