fix operator< and operator== not working as expected
This commit is contained in:
@@ -16,9 +16,18 @@ void DateTime::Init()
|
||||
DateTime DateTime::GetNowDateTime()
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
DateTime tNow;
|
||||
tm tNow;
|
||||
localtime_r( &now, &tNow );
|
||||
return tNow;
|
||||
DateTime dtNow;
|
||||
#define COPY_M( v ) dtNow.v = tNow.v;
|
||||
COPY_M( tm_year );
|
||||
COPY_M( tm_mon );
|
||||
COPY_M( tm_mday );
|
||||
COPY_M( tm_hour );
|
||||
COPY_M( tm_min );
|
||||
COPY_M( tm_sec );
|
||||
#undef COPY_M
|
||||
return dtNow;
|
||||
}
|
||||
|
||||
DateTime DateTime::GetNowDate()
|
||||
|
||||
Reference in New Issue
Block a user