date_day_span

With this function you can get the number of days between two dates. This value is always positive, and incomplete days will be returned as a fraction.

 

Syntax:

date_day_span(date1, date2);

ArgumentTypeDescription
date1DatetimeThe first datetime.
date2DatetimeThe datetime to compare it to.

 

Returns:

Real

 

Example:

diff = date_day_span(date_create_datetime(2011, 9, 15, 11, 4, 0), date_current_datetime());

This would set diff to the number of days between 15th September 2011, 11:04.0 and the current date and time.