Page 1 of 1

News date format

Posted: Fri Jan 27, 2012 7:06 pm
by root213
Hello, I have a question about date format in the news module.
Hope I've chosen the right section as the news module is not a third party module.

I used search, found some relative discussions, but no solution for my situation.

System info:
cmsms 1.10.3
News 2.12.3
php 5.2.17
mysql 5.1.54

The question:
I want the dates to be shown on russian or simply like that:
27.01.2012

For now dates in news are shown in english..
Here is the pic for those who don't understand what I mean:
Image (Jan)

My language is russian, I set it everywhere I can:
- during installation
- site admin\global settings
- my preferences\user preferences

Here are time zone and encoding settings from config.php file
$config['timezone'] = 'Europe/Moscow';
$config['default_encoding'] = 'utf-8';
$config['locale'] = 'utf-8';

Re: News date format

Posted: Sat Jan 28, 2012 2:42 am
by frankmanl
Hi Root 213,
Have a look at Site Admin > Global Settings > General Settings > Date Format String. Here you fill in your default date format.
Google for strftime and you'll find all possibilities.
In your case you would have to enter %d.%m.%Y.

Frank

Re: News date format

Posted: Sat Jan 28, 2012 7:27 am
by uniqu3
use $config['locale'] = 'ru_RU.utf-8'; in your config.php

Re: News date format

Posted: Sat Jan 28, 2012 9:03 am
by root213
Hello frankmanl, thanks this makes things much better!

Hello uniqu3, tried this but site still shows english months.

Anyway this time I can live with %d.%m.%Y.

Thank you.

Re: News date format

Posted: Sat Jan 28, 2012 10:57 am
by uniqu3
You could override it with a UDT.

Name it set_locale and use it on top of your Tempalte with {set_locale}

Code: Select all

setlocale(LC_ALL, array('ru_RU.UTF-8','ru_RU@euro','ru_RU','russian'));
To find out what locale is supported on your Server see this post: http://www.i-do-this.com/blog/59/Find-l ... your-Setup

Re: News date format

Posted: Tue Jan 31, 2012 1:46 pm
by root213
Thanks I'll try this.

Now I have a minor problem with posting news.
Whenever I try to add anything to URL: field, it shows the error
Invalid URL (maybe it is already used, or there are invalid characters) (Troubleshooting)
Even tried simply http://google.com - no result.