How to change Dates from US to UK format?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
scotch33
Dev Team Member
Dev Team Member
Posts: 285
Joined: Tue Feb 14, 2006 9:56 pm

How to change Dates from US to UK format?

Post by scotch33 »

Hi,

I want to change the dates in the system from MM/DD/YYYY to DD/MM/YYYY. How do I go about doing this? Thanks!
gfroyle

Re: How to change Dates from US to UK format?

Post by gfroyle »

Interesting question...

In config.php in the main cms directory, there is a line that says

$config['locale'] = ' ';

along with a comment that leaving it blank will use the web server's default locale for dates etc. 


But if your web server's default is set incorrectly (or by default) to US format, then you can alter the locale manually.

I put

$config['locale'] = 'en_AU';

and all the dates reverted to Australian format.

You might want

$config['locale'] = 'en_GB';

Good luck

Gordon

PS Of course, using EITHER DD/MM/YY or MM/DD/YY is going to confuse SOMEONE. If I have time, I might try to figure out where the dates are actually output and change the formatting string so that it says something like 3-Aug-06 which is still Australian/British style, but also unambiguous. It just requires changing a PHP formatting string, but its not a global config parameter so one would need to track down every place that the PHP function "date" is called.
beeswax

Re: How to change Dates from US to UK format?

Post by beeswax »

there isn't a config.php file in my CMSMS directory. how do I change dates in this case? thanks.
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: How to change Dates from US to UK format?

Post by Dee »

Euh, there's always a config.php file present inside your CMSMS root... maybe you don't see it due to permissions set on it?
beeswax

Re: How to change Dates from US to UK format?

Post by beeswax »

as you can see, there's no config.php. there's some other stuff in there as well which belongs to the hosting company. the only time i see config.php is when I create it for the initial install. am I looking in the wrong place?

[gelöscht durch Administrator]
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: How to change Dates from US to UK format?

Post by Dee »

CMSMS can't run without a config.php (it contains the paths to the files, database info and other settings), so it's definately there.
It does look like the right location, try logging into your Plesk admin and use it's file manager to check ownership and permissions on config.php.
beeswax

Re: How to change Dates from US to UK format?

Post by beeswax »

you're right, it's there. I've found another thread detailing how to change the date settings. It doesn't work site-wide, but for the news module which was causing the problems. If I can find the thread again I'll post it here. thanks for your help.
Post Reply

Return to “CMSMS Core”