Re: [SMARTY] Using Smarty Functions

From: Date: Sat, 02 Apr 2005 14:51:56 +0000
Subject: Re: [SMARTY] Using Smarty Functions
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12388@lists.php.net to get a copy of this message
Hi Reynier, Are you trying to get the current date in a certain format? If so this should work: Put this in your tpl {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"} or if you want a certain format on a date you want to pass then: tpl = {$yesterday|date_format:"%H:%M:%S"} php = $smarty->assign('yesterday', strtotime('-1 day')); More info at: http://smarty.php.net/manual/en/language.modifier.date.format.php Hope this helps, Nick --- Reynier Pérez Mira <reynierpm@.es> wrote: > Hi comunity. I'm new in use of Smarty Templates. I > try > to use the $smarty.now function but i don't know in > where place i put there. If is in .php file or is in > .tpl file? > In the first case how to assign values to var? > Take a look of part of my tpl code: > ========================================================= > <tr><td class="td image"><span class="td"><img > src="themes/images/clockicon.gif" alt="Hora del > Servidor" border="0" align="absmiddle" > class="cursor"></span></td> > <td class="td > padding-menu">{$HOUR.now|date_format:"%Y-%m-%d > %H:%M:%S"}</td></tr> > ========================================================= > are this OK or wrong?? > > Regards > > Reynier Pérez MiraBlog de ReynierPM > > > > ______________________________________________ > Renovamos el Correo Yahoo!: ¡250 MB GRATIS! > Nuevos servicios, más seguridad > http://correo.yahoo.es > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Send instant messages to your online friends http://uk.messenger.yahoo.com

« previous php.smarty.general (#12388) next »