smarty - How to find difference between two dates in smart with using php -


in task try find out difference between 2 dates accordingly when written code in php , try using smarty code not showing any result don't know mistake, written right code in php , using date_format in smarty print code isn't working. kindly me out how can solve this.

php code:

<?php     $startdate = maketimestamp($startdate_year, $startdate_month, $startdate_day);      function maketimestamp($year='2017', $month='04', $day='03')     {        if(empty($year)) {            $year = strftime('%y');        }        if(empty($month)) {            $month = strftime('%m');        }        if(empty($day)) {            $day = strftime('%d');        }         return mktime(9, 12, 2017, $month, $day, $year);     } ?> 

smarty code:

<html>     <head>         <title>screen 5</title>     </head>     <body>         <{$startdate|date_format:"%m/%d/%y"}>     </body> </html>       


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -