Re: [SMARTY] date formatting

From: Date: Thu, 04 Oct 2007 13:06:24 +0000
Subject: Re: [SMARTY] date formatting
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13762@lists.php.net to get a copy of this message
hello, > hello, > > in my template I have an input field which contains the date a shelf > expires. > > Given the value for $shelf_expire_value is 2099-12-31 the template > returns just that. > > If I use: > value="{$shelf_expire_value|date_format:'%d.%m.%Y'}" instead of > value="{$shelf_expire_value}" I get the result: 04.10.2007, which is > today's date... > > Is date_format only working with a certain type (format) of string? How > can I get the desired output of: 31.12.2099? The documentation says: "Dates can be passed to Smarty as unix timestamps, mysql timestamps or any string made up of month day year, parsable by php's strtotime()." The strtotime function accepts only english dates. 31.12.2099 is not an english date!! Take a look here : <http://fr3.php.net/manual/en/function.strtotime.php> Regards, Vincent

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