Published on : August 18, 2020
Title | : | php.date_diff |
Purpose | : | Calculate the difference between two dates. |
Syntax | : | [php.date_diff p1={template.date1} p2={template.date2} o.set=template.datediff /] |
Input Parameter | : | p1: datetime p2: datetime p3: absolute (Optional) Specifies a Boolean value. TRUE indicates that the interval/difference MUST be positive. Default is FALSE |
Return Value | : | Returns a DateInterval object on success that represents the difference between the two dates. FALSE on failure |
Example | [php.date_create p1=”2013-03-15″ o.set=template.date1 /] [php.date_create p1=”2013-12-12″ o.set=template.date2 /] [php.date_diff p1={template.date1} p2={template.date2} o.set=template.datediff /] [template.echo datediff/] |