//from compareElementValues:
|
case Timestamp:
|
// unsigned compare for timestamps - note they are not really dates but (ordinal + time_t)
|
if ( l.date() < r.date() )
|
return -1;
|
return l.date() == r.date() ? 0 : 1;
|
case Date:
|
{
|
long long a = (long long) l.Date().millis;
|
long long b = (long long) r.Date().millis;
|
if( a < b )
|
return -1;
|
return a == b ? 0 : 1;
|
}
|
As from the code above doing a comparison with l as TimeStamp and r as Date is fine, but doing a comparison with l as Date and r as TimeStamp will throw an assertion because of it uses Date() instead of date() which has strict checking.
P.S. also pay attention to the comment:
// unsigned compare for timestamps - note they are not really dates but (ordinal + time_t)
|