Menu Samaritan's Purse

DATE_DIFF

Returns the difference between two DateTime objects

SYNTAX

date_diff ( DateTimeInterface $originObject , DateTimeInterface $targetObject [, bool $absolute = FALSE ] ) : DateInterval

PARAMETERS

originObject

The date to compare from.

targetObject

The date to compare to.

absolute

Should the interval be forced to be positive?

RETURN

The DateInterval object representing the difference between the two dates or FALSE on failure.

EXAMPLES

ORIGINOBJECT TARGETOBJECT

-1 days

ABSOLUTE

+1 days

PHP