Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Use date_format plugin to display date into RFC-822 (RSS)

 
Post new topic   Reply to topic    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
philippecd
Smarty n00b


Joined: 24 Aug 2010
Posts: 3

PostPosted: Tue Aug 24, 2010 1:02 pm    Post subject: Use date_format plugin to display date into RFC-822 (RSS) Reply with quote

Hello

I want to use date_format plugin into an RSS template.
But, i can't find the correct Parameter.

Correct format: Tue, 24 Aug 2010 00:00:00 +0000

Someone has already make that? What's the parameter to use?

Thanks a lot
Philippe
Back to top
View user's profile Send private message
elpmis
Smarty Elite


Joined: 07 Jun 2007
Posts: 321

PostPosted: Tue Aug 24, 2010 1:26 pm    Post subject: Reply with quote

Have you read this?

http://www.smarty.net/manual/en/language.modifier.date.format.php
Back to top
View user's profile Send private message
philippecd
Smarty n00b


Joined: 24 Aug 2010
Posts: 3

PostPosted: Tue Aug 24, 2010 1:38 pm    Post subject: Reply with quote

In french ... and translation seems to be false for some params.

Example for %b:
=> In english: abbreviated month name according to the current locale
=> In french: it speek about the abbreviated day and not abbreviated month

Is there no equivalent to:
Code:
<?php date('r'); ?>


Whith this documentation, if i'm correct it would be:

Code:
 {$date_var|date_format:"%a, %d %b %Y %H:%I:%S %Z"}


Is it true?

Thanks
Philippe
Back to top
View user's profile Send private message
philippecd
Smarty n00b


Joined: 24 Aug 2010
Posts: 3

PostPosted: Fri Aug 27, 2010 12:45 pm    Post subject: Reply with quote

I found the solution Smile

{$date|date_format:"%a, %d %b %Y %H:%M:%S %z"}

Philippe
Back to top
View user's profile Send private message
Crutis
Smarty n00b


Joined: 27 Sep 2010
Posts: 3

PostPosted: Mon Sep 27, 2010 10:55 pm    Post subject: Reply with quote

Date format is different for many countries/languages
I've rewrite all needen plugins to russian for myself.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP