smarty icon indicating copy to clipboard operation
smarty copied to clipboard

Warning: date_format() expects parameter 1 to be DateTimeInterface, integer given in

Open luduoxin opened this issue 10 years ago • 1 comments

I am attempting to format a Unix timestamp utilizing the date_format() variable modifier as specified in the manual in php7. However, I seem to be running into some problems. Warning: date_format() expects parameter 1 to be DateTimeInterface, integer given in /data/www/test/index.php on line 41

luduoxin avatar Aug 24 '16 14:08 luduoxin

There is a name ambiguity between the date_format modifier plugin and the PHP function date_format(). If you use modifier Smarty first to find it in the plugins folder. If not found there Smarty looks for a PHP function if not disabled by Security. It looks like that the plugins folder was not configured right when the template was compiled so that Smarty took the PHP function. Once the template is compiled correcting the plugins folder does not help. You must deleted the existing compiled templates to solve the problem. The plugins handling will change for other reasons in the near future. Forcing manually the recompilation of templates will then be no longer required required.

uwetews avatar Sep 01 '16 23:09 uwetews