FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » how can i change the format of DATE
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
how can i change the format of DATE [message #9907] Sun, 11 May 2003 04:41 Go to next message
redhat71   Hong Kong
Messages: 32
Registered: February 2003
Karma: 0
Member

currently it is "Sun, 11 May 2003"

i'd like to use "Sun, 2003-05-11", or even simpler "2003-05-11"

thanks

(ps: i don't know php at all, i am expecting a more detailed answer such like: edit file xxx, change code "yyy" to "zzz")
Re:how can i change the format of DATE [message #9947 is a reply to message #9907] Tue, 13 May 2003 14:10 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You need to edit .tmpl files & change the format in tags that look like

{DATE: r[2] %a, %d %B %Y}

you need to change the list of parameters after the 2nd space "%a, %d %B %Y". To see the supported parameters (controlling appearance of date) read up on http://www.php.net/manual/en/function.strftime.php


FUDforum Core Developer
Re:how can i change the format of DATE [message #9961 is a reply to message #9947] Tue, 13 May 2003 14:33 Go to previous messageGo to next message
redhat71   China
Messages: 32
Registered: February 2003
Karma: 0
Member

done, thanks a lot !
Re:how can i change the format of DATE [message #22085 is a reply to message #9947] Wed, 12 January 2005 23:49 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
Ilia - Can you be a little more specific as to which template files have to be altered to change the date/time format on the index and individual message pages? - I've looked at various files in the template editor and can't find a '{DATE' tag anywhere.

For what it's worth I think that this would be a good thing to build into the global settings page.

Chris
Re:how can i change the format of DATE [message #22097 is a reply to message #22085] Fri, 14 January 2005 18:19 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
All date formats are stored inside a single template called: date_formats.tmpl

FUDforum Core Developer
Re:how can i change the format of DATE [message #22116 is a reply to message #22097] Sun, 16 January 2005 18:55 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
This file doesn't appear in my template editor Ilia - should it?

Can you please tell me the exact location of date_formats.tmpl so that I can make some changes???

Thanks in advance

Chris
Re:how can i change the format of DATE [message #22117 is a reply to message #22116] Sun, 16 January 2005 19:49 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Look in FUDForumData/thm/default/tmpl/date_formats.tmpl
thanks for that! (n/t) [message #22118 is a reply to message #22117] Sun, 16 January 2005 22:15 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
No Message Body
Problem.... [message #22119 is a reply to message #22117] Mon, 17 January 2005 00:25 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
.... I am trying to get my 'message posted date' to show as follows:

17-Jan-2005 - 12:13:am

I tried to modify this section in the date_formats.tmpl file as follows:

{SECTION: dmsg_post_date}
{DATE: obj->post_stamp %d-%m-%Y - %h:%i:%A}
{SECTION: END}

However it displays incorrectly:

17-01-2005 - Jan:%i:Monday

Can you tell me where I'm going wrong please?

Chris

Re: Problem.... [message #22121 is a reply to message #22119] Mon, 17 January 2005 11:39 Go to previous messageGo to next message
ggray is currently offline  ggray   Ukraine
Messages: 96
Registered: October 2004
Location: Crimea: Simferopol
Karma: 0
Member

use

{SECTION: dmsg_post_date}
{DATE: obj->post_stamp %d-%b-%Y - %I:%M:%P}
{SECTION: END}
Doesn't work... [message #22122 is a reply to message #22121] Mon, 17 January 2005 11:48 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
.... That produces the following on my forum:

15-01-2005 - Jan:%i:Saturday

Is there another problem do you think?

Chris
Re: Doesn't work... [message #22123 is a reply to message #22122] Mon, 17 January 2005 12:03 Go to previous messageGo to next message
ggray is currently offline  ggray   Ukraine
Messages: 96
Registered: October 2004
Location: Crimea: Simferopol
Karma: 0
Member

welshchris ÐÉÓÁÌ(Á) ðÎÄ, 17 ñÎ×ÁÒÑ 2005 13:48

.... That produces the following on my forum:

15-01-2005 - Jan:%i:Saturday

Is there another problem do you think?

Chris


using my last format??? Shocked
it`s can`t be...

are you check "dmsg_post_date" entry?
My mistake.... [message #22124 is a reply to message #22123] Mon, 17 January 2005 12:12 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
..... I was editing the file using my ftp package and the files weren't uinlocked, so no modifications were being made.

It now works fine - thanks very much for you help on this! Very Happy

Chris
Re: My mistake.... [message #22125 is a reply to message #22124] Mon, 17 January 2005 12:18 Go to previous message
ggray is currently offline  ggray   Ukraine
Messages: 96
Registered: October 2004
Location: Crimea: Simferopol
Karma: 0
Member

good...

for testing date format you may use date utility in Linux:
#>date +%d-%b-%Y-%I:%M:%P
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Upgrade Problem
Next Topic: Rebuild search index
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 22:15:42 GMT 2024

Total time taken to generate the page: 0.02673 seconds