Re: [SMARTY] date formatting
[email protected] ("Vincent DEBOUT") Thu, 4 Oct 2007 15:06:24 +0200 (CEST)
| Newsgroups | php.smarty.general |
|---|---|
| Message-ID | <[email protected]> |
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