1
redheadedrod
How to change date format in 2.4.3?

I need to change the date format for my sites to the dd/mm/yyyy format instead of the yyyy/dd/mm format that comes with the default system.

When I did a search I found messages referring to older systems but that does not work with the newer setups.

I found what seemed to be the setting in the file...

/language/english/locale.php

and modified the following line to read as follows...

define("_YEARMONTHDAY", "n/j/Y G:i");

This did NOT seem to change it in my system and I am stumped on how to modify this. It SHOULD be a simple fix but I have not been able to find mention of it anywhere and I have already wasted way more time then I should have.

I am assuming that this date format is used in the modules as well so if I fix it in one place it should be fixed across the board.

Thanks for any help on this.

Rodney

2
Anonymous
Re: How to change date format in 2.4.3?
  • 2010/1/16 9:17

  • Anonymous

  • Posts: 0

  • Since:


Quote:
redheadedrod wrote:

/language/english/locale.php


Same folder..... global.php, lines 174 - 176:

define("_DATESTRING","d/m/Y H:i:s");
define("_MEDIUMDATESTRING","d/m/Y H:i");
define("_SHORTDATESTRING","d/m/Y");


global.php should alter system-wide formatting so go for this one first.

locale.php affects certain specific modules, e.g. cbb, and seems to be legacy file from frameworks when the 2.3.x branch was released.

Certain modules also allow you to set specific formats from within the modules preferences if you want something specifi for them. News and ExtCal spring to minf from my set-up.

HTH

3
redheadedrod
Re: How to change date format in 2.4.3?

Thanks, this worked like a charm. Not sure how I missed them because I DID look in that file first...

I am assuming any modules and such that the date is not correct after changing this will likely have their own formatting somewhere within the module.




PS. To anyone reading this the codes in the format string are PHP formatting characters.

4
Anonymous
Re: How to change date format in 2.4.3?
  • 2010/1/20 8:57

  • Anonymous

  • Posts: 0

  • Since:


Quote:
redheadedrod wrote:

Thanks, this worked like a charm.


Glad you're sorted

Quote:
redheadedrod wrote:

I am assuming any modules and such that the date is not correct after changing this will likely have their own formatting somewhere within the module.


Not quite my understanding (which could be wrong!).

My understanding is that the vast majority of modules take the settings in global.php. However, you can use the settings in the module's preferences (e.g. News, ExtCal) to over-ride the global settings if you like.

There are a few modules that don't either take the global settings or have settings in the module's preferences. In these few cases you will have to track down where the date format is set within the module's files (probably in the /language folder).

CBB 3.08 is the only module I personally know that uses locale.php but there may well be others (perhaps from DJ/phppp's own modules) that used Frameworks from the older XOOPS core.

Quote:
redheadedrod wrote:

PS. To anyone reading this the codes in the format string are PHP formatting characters.


Yep, and there's a helpful listing in global.php just above the settings themselves.

Login

Who's Online

336 user(s) are online (206 user(s) are browsing Support Forums)


Members: 0


Guests: 336


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits