PDA

View Full Version : Change Date Format


triadib
11th of October 2006 (Wed), 09:07
Hi Pekka,

I have been upgraded to 2.01 without any major problems and now start to customize eE for integrating into CMS Joomla.
In 1.5RC4 the standard date format MM-DD-YYYY changed while changing the language (german) to the date format DD.MM.YYYY.

Can you give me a hint where I can change this in 2.01?

I suggest to enter a php-date string in SETUP_settings.php... so it would be possible to extend date to weekday, D. monthname Year or someting else.

Best regards
Dirk

jeronimo
11th of October 2006 (Wed), 17:17
Log in into your admin pannel, then go to Global settings.
On the botom of your page you can change this.

It also is needed to update the setting in your languages files. (for me in the NLA (netherlands) version I needed to change it to dutch in global.php)

If you translated everything and uses the German language file, you should change the 5th line in global.php to
setlocale (LC_TIME , "german");

Hope this works for you

triadib
12th of October 2006 (Thu), 03:44
Hi jeronimo,

thank you - it works.

For further customization I would prefer the string:
Friday, 1. December 2002

The date_format settings are being updated by EDITOR_settings_global with function ee_option (SCRIPT_common_functions) but I don't understand the settings of $var and $comp and $shown.
Does anybody know the correct setting for the string above?

Regards
Dirk

triadib
12th of October 2006 (Thu), 04:21
For everyone who ist interested in customizing date_format:

1.
- edit admin/EDITOR_settings_global.php
- insert line behind

ee_option("16",$s_dateformat,"'preferred date representation of current language', Friday");

- for example

ee_option("17",$s_dateformat,"Friday, 1. February 2002");


2.
- edit basecode/SCRIPT_common_functions.php
- insert lines behind

case 16:
$date2 = strftime("%x, %A",$date);
break;

- like these

case 17:
$date2 = strftime("%A, %e. %B %Y",$date);
break;


Different combinations you'll find by searching strftime() and set parameters as described.

Dirk