HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[SOLVED] change date display format

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#107142 (In Topic #20887)
Avatar

Fan in action

Anyone know where/how to change the way dates are displayed? Looking to change it from
January 25th 2015, 1:10 PM
to
25 January 2015, 1:10 PM

Didn't see anything in the admin area but maybe I missed it.

Thanks, John


Last edit: by John Pollard
Back to the top
 
Posted
Rating:
#107152
Avatar

Community saint

It's in the global.ini file. See this topic: View topic: How time is show? - ocPortal.com
Back to the top
 
Posted
Rating:
#107153
Avatar

Fan in action

Thanks
Back to the top
 
Posted
Rating:
#107154
Avatar

Community saint

Actually, it looks like the .ini file already uses the format you want. You may need to track down where the date is located based on which web page you want to change it on. It could be located in another .ini file or a template file. Knowing which web page it's on and what module or block is actually rendering the date, you should be able to trace it back to a specific .ini file or template.
Back to the top
 
Posted
Rating:
#107155
Avatar

Fan in action

Hmm, ok, I'm wanting things to be consistent globally and right now the forums display as my first example. Now that I have a clue where to look, I should be able to work it out.
Thanks again.
Wow, this place is coming alive. For a month or so, I was the only one here aside from Chris.
Back to the top
 
Posted
Rating:
#107156
Avatar

Community saint

Well, I was wrong. The date in the global.ini file is probably the place you need to edit. I was looking at an older version that did have the date in the format you prefer. I think changing the date_regular_date global.ini string to:

date_regular_date=%e%k %B %Y

should give you the day Month year format you're looking for. The date_verbose_date adds the day of the week (Monday, Tuesday, etc.) so you might need to adjust that one as well.
Back to the top
 
Posted
Rating:
#107158
Avatar

Fan in action

Cool, Thanks again. I actually had that task on a back burner as I didn't expect a reply for a while. LOL I'm on xubuntu so I'm a bit familiar with the formats as that's how the date/clock/time is changed on the panel aka taskbar.
Back to the top
 
Posted
Item has a rating of 5 (Liked by Jason Verhagen)  
Rating:
#107163
Avatar

Fan in action

That put things in the right order but it was still picking up the st, th, nd etc for the day of month. (called ordinal suffix, learn something new everyday) Oddly enough removing the %k got rid of the ordinal suffix but php.net for php4, php5 says strftime %k is the two digit representation of the hour in 24-hour format but since that wasn't being displayed anyway, I took out the %k and it's good now. Not sure where the discrepancy is.

So for anyone that finds this thread, Chris' link to uk2.php.net in the above referenced thread was dead as that thread is from 2008. Here's a link to the current US version. http://php.net/manual/en/function.strftime.php

As per Chris' suggestion to go through admin rather than cpanel/ftp to make the change thereby clearing the language cache and saving your changes as an override file to update proof things, that is a bit outdated as well.
Admin Zone>Style>Translate/re-phrase the software will get you there and choose global. It's pretty close to the top of that global.ini file.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: