Re: [SMARTY] Using Smarty Functions

From: Date: Sat, 02 Apr 2005 21:41:51 +0000
Subject: Re: [SMARTY] Using Smarty Functions
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12389@lists.php.net to get a copy of this message
Hi Reynier, I had to look into this myself, so we both learn something today :) In your php code do this: setlocale(LC_ALL, 'es_ES'); This will set your local language to Spanish, at least on my pc. You might need to check your environment by running the command below to see a complete list of settings: system('locale -a'); This should display the date now in Spanish. It is also possible to do what I done and put it all in the tpl see below: {php} setlocale(LC_ALL, 'es_ES'); // Display all possible settings //system('locale -a'); {/php} {$smarty.now|date_format:"%Y-%m-%d%H:%M:%S %B"} %B = Month. Just to make sure it worked :) Regards, Nick --- Reynier Pérez Mira <> wrote: > Thanks now it works, but I have another questions. > How > can I format date into spanish language because by > default the language is english ?? I see something > about set_locale but I not know how to use them. > > Regards > > Reynier Pérez MiraBlog de ReynierPM > > > > ______________________________________________ > Renovamos el Correo Yahoo!: ¡250 MB GRATIS! > Nuevos servicios, más seguridad > http://correo.yahoo.es > Send instant messages to your online friends http://uk.messenger.yahoo.com

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