Development tools : Global functions : Date category : daysBetween
  
daysBetween
Description
Returns a double number representing the days between the two dates in double as time in day is taken into account.
Usage
Client side: Y
Server side: Y
Syntax
Double daysBetween(Date date1, Date date2).
Argument
date1
The date to be compared. The argument can by any date type data.
date2
The date to compare. The argument can by any date type data.
Return
Returns the days between the two dates in double as time in day is taken into account. If date2 is before date1, negative number will be returned. If any of argument is empty (null), -1 will be returned.
Example
daysBetween(2010/01/20 12:00:00,2010/01/21 18:00:00)
returns 1.25.
daysBetween(2010/01/20 23:00:00,2010/01/21 02:00:00)
returns 0.125.
daysBetween(2010/01/21 02:00:00,2010/01/20 23:00:00)
returns -0.125.
Go up to
Date category