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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
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 00:41 Go to next message
redhat71   Hong Kong
Messages: 32
Registered: February 2003
Karma: 0
Member
add to buddy list
ignore all messages by this user

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 10: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
add to buddy list
ignore all messages by this user
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 10:33 Go to previous messageGo to next message
redhat71   China
Messages: 32
Registered: February 2003
Karma: 0
Member
add to buddy list
ignore all messages by this user

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 18:49 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
add to buddy list
ignore all messages by this user
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 13: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
add to buddy list
ignore all messages by this user
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 13:55 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
add to buddy list
ignore all messages by this user
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 14:49 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
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 17:15 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
add to buddy list
ignore all messages by this user
No Message Body
Problem.... [message #22119 is a reply to message #22117] Sun, 16 January 2005 19:25 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
add to buddy list
ignore all messages by this user
.... 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 06: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
add to buddy list
ignore all messages by this user

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 06:48 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
add to buddy list
ignore all messages by this user
.... 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 07: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
add to buddy list
ignore all messages by this user

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 07:12 Go to previous messageGo to next message
welshchris is currently offline  welshchris   United Kingdom
Messages: 35
Registered: December 2004
Karma: 0
Member
add to buddy list
ignore all messages by this user
..... 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 07:18 Go to previous message
ggray is currently offline  ggray   Ukraine
Messages: 96
Registered: October 2004
Location: Crimea: Simferopol
Karma: 0
Member
add to buddy list
ignore all messages by this user

good...

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

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

Current Time: Sun Oct 22 02:36:36 EDT 2017

Total time taken to generate the page: 0.00882 seconds