Time :: compare - Compare time points
The function compares the time point stored in the object with the time passed in the parameter.
The function returns -1 when the time point is lower than the time passed parameter, 1 when the the time point is greater than the one passed and 0 , when both values are equal.
The function throws an exception, when values are invalid or not comparable.
The result of a comparison is an integer value with the following meaning:
- 0: both operands have the same value
- 1: the calling operand is greater than the passed operand
- -1: the calling operand is smaller than the passed operand
Implementation overview
- Compare time value with string data
Time :: compare ( sTime ) - Compare two time points
Time :: compare ( cTime )
Implementation details
-
Compare time value with string data
int32 Time  :: compare ( odaba::String &sTime )
The function compares the time value with the time point passed in sTime .
- sTime
- Time value in string format
Time values are passed as string value with the following format:
hh[:mm[:ss[,cc]
Time values must not contain spaces.
to list
- sTime
- Time value in string format
-
Compare two time points
int32 Time  :: compare ( odaba::Time &cTime )
The function compares the time value with the time value passed in cTime .
- cTime
- Time value
The time value is passed in the ODABA Interface::Time format and provides time in 1/100th seconds.
to list
- cTime
- Time value