Publisher review:This is a Smarty Function file that can be installed into your plugins for smarty to provide the capability of calculating the time between two dates in either minutes, days, weeks, and years. This is a Smarty Function file that can be installed into your plugins for smarty to provide the capability of calculating the time between two dates in either minutes, days, weeks, and years.
Input
- date1 = "mm/dd/yyyy" or "yyyy/mm/dd" or "yyyy-mm-dd"
- date2 = "mm/dd/yyyy" or "yyyy/mm/dd" or "yyyy-mm-dd" or $smarty.now
- assign = name of variable to assign difference to
- interval = "days" (default), "weeks", "years"
Examples
- {date_diff date1="5/12/2003" date2=$smarty.now interval="weeks"}
- {date_diff date1="5/12/2003" date2="5/10/2008" assign="diff"}{$diff}
date_diff Smarty Function is a PHP script for Snippets scripts design by Matt DeKok.
It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.
Operating system:Windows / Linux / Mac OS / BSD / Solaris