Fork me on GitHub

How to change it up with pndate_format?  Bottom

  • In a template, I'm using and it's displaying a nice short date. Cool... So, how to format it differently?

    Thanks
  • from the Smarty manual

    Quote


    index.php:

    $Smarty = new Smarty;
    $smarty->assign('yesterday', strtotime('-1 day'));
    $smarty->display('index.tpl');

    index.tpl:


    {$smarty.now|date_format}
    {$smarty.now|date_format:"%A, %B %e, %Y"}
    {$smarty.now|date_format:"%H:%M:%S"}
    {$yesterday|date_format}
    {$yesterday|date_format:"%A, %B %e, %Y"}
    {$yesterday|date_format:"%H:%M:%S"}

    OUTPUT:

    Feb 6, 2001
    Tuesday, February 6, 2001
    14:33:00
    Feb 5, 2001
    Monday, February 5, 2001
    14:33:00


    The modifier name is just changed in PN to pndate_format
  • Thanks... :) I'm still coming to grips with the fact that everything Smarty is fair game in the templates...
  • alarconcepts

    Thanks... :) I'm still coming to grips with the fact that everything Smarty is fair game in the templates...


    LOL I hear ya, almost feels like cheating...

    --
    Under Construction!

This list is based on users active over the last 60 minutes.