Date :: compare - Compare dates
The function compares the date stored in the object with the date passed in the parameter.
The function returns -1 when the date is lower than the date passed as parameter, 1 when the the date 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 two dates
Date :: compare ( cDate ) - Compare date value with string data
Date :: compare ( sDate )
Implementation details
-
Compare two dates
int32 Date  :: compare ( odaba::Date &cDate )
The function compares the date value with the date value passed in cDate .
- cDate
- Date
The date contains day, month and year, but not the time.
to list
- cDate
- Date
-
Compare date value with string data
int32 Date  :: compare ( odaba::String &sDate )
The function compares the date value with the date passed in sDate .
- sDate
- Date value in string format
Date values can be passed in different ways as string value:
Standard: yyyy-mm-dd or yyyymmdd
English: mm/dd/yyyy
German: dd.mm.yyyy
The type of date is determined from the separator used.
to list
- sDate
- Date value in string format