0
I am developing a PHP page, using MVC structure and rendering tamplete files with Smarty.
However, it was difficult to get a date via Mysql (see format: YEAR-MONTH-DAY HOUR:MINUTE:SECOND
I would like it to be presented in the following form: DAY/MONTH/YEAR - TIME:MINUTE
I already managed to get the data in Mysql, as shown below:
$feed = new feedAction();
$feedPostsSelect = $feed->select();
$view->assign("feedList",$feedPostsSelect);
$view->assign("textFeed", "text");
$view->assign("usuarioFeed", "idauthor");
$view->assign("publishDateFeed", "publishDate");
And in the tpl file:
{$row.publishDate}
I’ve tried as in Smarty’s timestamp shows, that would be:
{$smarty.now|date_format:"%d/%m/%Y - %H:%M"}
But using $Row.publishDate|date_format does not work if you want to display some data on the screen.
How to proceed?
Thank you for your attention!