pull code out of header

This commit is contained in:
Glenn Maynard
2005-08-12 03:22:44 +00:00
parent ca72464405
commit fbfafcecbb
2 changed files with 29 additions and 25 deletions
+27
View File
@@ -14,6 +14,33 @@ void DateTime::Init()
ZERO( *this );
}
bool DateTime::operator<( const DateTime& other ) const
{
#define COMPARE( v ) if(v<other.v) return true; if(v>other.v) return false;
COMPARE( tm_year );
COMPARE( tm_mon );
COMPARE( tm_mday );
COMPARE( tm_hour );
COMPARE( tm_min );
COMPARE( tm_sec );
#undef COMPARE
// they're equal
return false;
}
bool DateTime::operator==( const DateTime& other ) const
{
#define COMPARE(x) if( x!=other.x ) return false;
COMPARE( tm_year );
COMPARE( tm_mon );
COMPARE( tm_mday );
COMPARE( tm_hour );
COMPARE( tm_min );
COMPARE( tm_sec );
#undef COMPARE
return true;
}
DateTime DateTime::GetNowDateTime()
{
time_t now = time(NULL);