Re: [SMARTY] date format not quite right
| From: | Desiree Rivera | Date: | Wed, 15 Jan 2003 21:19:49 +0000 |
| Subject: | Re: [SMARTY] date format not quite right | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7210@lists.php.net to get a copy of this message | ||
F.Y.I.
From what I can tell, it's an issue with PHP, because smary uses PHP's strftime() Here's what I found:
http://bugs.php.net/bug.php?id=18520
Paul's idea sounds like a good work-around for now though. Another option might be just to use the PHP code in the template file. This works for me in my .tpl file:
{php}
print date("l, F j, Y");
{/php}
At 03:59 PM 1/15/2003 -0500, paul@dostuff.net wrote:
Desiree Rivera wrote:I'm having the same problem. Is this a bug? I looked through the docs and email archives without luck. Any ideas? At 01:11 PM 1/15/2003 -0700, Hoffman, Geoffrey wrote:I had exactly the same problem. What I did was modify the plugin file called modifier.date_format.php and changed strftime to date and then used the date syntax: http://www.php.net/date I know that that's a lame way to do it and is not future compatible, but it worked for me for the time being. ~Paul -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpSmarty version 2.3.1 (Windows 2k, Apache) On index.tpl I have {$smarty.now|date_format:"%A, %B %e, %Y"} and the output is Wednesday, January , 2003 {$smarty.now|date_format:"%A, %B %d, %Y"} outputs Wednesday, January 15, 2003 I'd like no leading zero on single-digit days. Am I missing something? Geoff