DateCompare
Compares the difference between two dates - returning 0 if equal, -1 if date2 is less than date1 and 1 if the inverse
Method Signature
Arguments
Argument
Type
Required
Description
Default
date1
any
true
The reference date object
date2
any
true
The date which to compare against date1
datepart
string
false
Examples
Compare Two Dates by Year
Result: 0
Compare Two Dates by Day
Returns 1 because date1 is greater than date 2
Result: 1
Member function example
Result: -1
Additional Examples
Related
Last updated
Was this helpful?