System:Template:daysBetween

From Aspen Documentation

Returns the number of days between two dates.

Since 1.0

Contents

Arguments

float daysBetween ( $start, $end)

start
A date string of the first date.
end
A date string of the second date.

Returns

Returns an un-rounded float value.

Notes

  • This may return a negative number if the second date is before the first.

Examples

The following is an example of how many days exist between today and January 1, 2011. The date formats may be any valid output of the php date function.

print $this->daysBetween(date("Y-m-d"), '1/1/2011');

Prints: 655.04166666667

print $this->daysBetween(date("Y-m-d"), '4/26/1982');

Prints: -9822