Page 1 of 1

Consistent Date Format - Site and Administrator

Posted: Wed Jan 09, 2019 7:35 pm
by LukeDouglas
I have a date preference of MONTH DAY, YEAR or MONTH DATE, YEAR HOUR:MINUTE that I want to use on all of my clients websites as they are U.S. based. It appears that there is NO single place I can change this PHP date layout.

I did some checking via the search field in Language / Overrides and found these settings:

Site:

DATE_FORMAT_LC
l, d F Y
DATE_FORMAT_LC1
l, d F Y
DATE_FORMAT_LC2
l, d F Y H:i
DATE_FORMAT_LC3
d F Y

Administrator:

DATE_FORMAT_LC
l, d F Y
DATE_FORMAT_LC1
l, d F Y
DATE_FORMAT_LC2
l, d F Y H:i
DATE_FORMAT_LC3
d F Y
DATE_FORMAT_LC4
Y-m-d
DATE_FORMAT_LC5
Y-m-d H:i
DATE_FORMAT_LC6
Y-m-d H:i:s

Do I have to add a new language override for English (en-GB) using either "F j, Y" or "m-d-Y" for each of these settings and for each of my clients websites (70 in all)? OR is there an single place or easier way to accomplish this need?

Re: Consistent Date Format - Site and Administrator

Posted: Wed Jan 09, 2019 8:38 pm
by sozzled
Try using the US Language pack for J! 3.x: https://community.joomla.org/translatio ... ation.html

Re: Consistent Date Format - Site and Administrator

Posted: Wed Jan 09, 2019 9:35 pm
by LukeDouglas
Sozzled,

Is this the same US language pack I already have or is it one that has these date formats M-D-Y HH:SS already modified?

Re: Consistent Date Format - Site and Administrator

Posted: Thu Jan 10, 2019 2:21 am
by sozzled
LukeDouglas wrote:
Wed Jan 09, 2019 9:35 pm
Is this the same US language pack I already have or is it one that has these date formats M-D-Y HH:SS already modified?
I haven't a clue what you may have. I don't use this language pack myself; I'm an Australian. These US date formats are only used in four countries in the world, you know.

Re: Consistent Date Format - Site and Administrator

Posted: Thu Jan 10, 2019 9:16 am
by imanickam
LukeDouglas wrote:
Wed Jan 09, 2019 7:35 pm
It appears that there is NO single place I can change this PHP date layout.
True. Be informed that the date format customization is done within the CMS (ie Joomla).

Be aware that the language overrides are stored in appropriate language override files. For the language English-US (en-US), the override file is named as en-US.override.ini

For the administration, the override files are located in the directory \administrator\language\overrides and for the site the override files are located in the directory \language\overrides.

What I would suggest is to create language overrides in a development environment and test them out. Once you are happy, copy the override files of administration and site to the appropriate locations in different sites. This would be a one time exercise.

Food for thought:
Other date format related language strings are

Code: Select all

DATE_FORMAT_JS1="y-m-d"
DATE_FORMAT_CALENDAR_DATE="%d-%m-%Y"
DATE_FORMAT_CALENDAR_DATETIME="%d-%m-%Y %H:%M:%S"
DATE_FORMAT_FILTER_DATE="d-[URL banned]"
DATE_FORMAT_FILTER_DATETIME="d-[URL banned] H:i:s"
You may look into these language strings as well.

Note:
You could suggest these changes to the English-US language pack coordinator. As Joomla! 3.9.2 is expected to be released in about a week or so, in case if the coordinator could make these changes in the language pack, all that would be required is to update the language pack.

Re: Consistent Date Format - Site and Administrator

Posted: Thu Jan 10, 2019 4:15 pm
by LukeDouglas
I created language overrides and now the dates display as the client requested.

I do feel that a single full-date (month day year hour minute second) display setting for 'global' use throughout the website, both site and administrator, should be a dropdown option in the global settings. Language overrides could still take precedence. By doing this, it would reduce the need for a lot of language overrides. Just a thought.

Re: Consistent Date Format - Site and Administrator

Posted: Thu Jan 10, 2019 5:17 pm
by Per Yngve Berg
en-GB, the default in Joomla is British English. You have to switch to en-US to get the dates correct.

Re: Consistent Date Format - Site and Administrator

Posted: Thu Jan 10, 2019 5:36 pm
by LukeDouglas
Per Yngve Berg wrote:
Thu Jan 10, 2019 5:17 pm
en-GB, the default in Joomla is British English. You have to switch to en-US to get the dates correct.
Per Yngve Berg, thanks. It never ceases to amaze me that you can still learn something about Joomla even though you have developed websites using it since the break from Mambo back in 2005. I never made the 'connection' between "en-GB' and 'en-US' in the Joomla settings as it comes defaulted in the 'en-GB' language because as I simply 'overlooked' the 'en-US' language setting when installing Joomla which I have done for over 150 websites in the past 14 years. Now I know everyone is probably rolling their eyes at this admission and there is really no excuse. I guess I do need to get my eyesight checked. :)

In thinking about this, I can understand why 'en-GB' is the default setting during the installation procedure as I did some research and it appears that Joomla is used in more countries using 'en-GB'. The US is way down the list. It's an American thing where we 'believe' we should come first. LOL

In my research, I was really surprised that Joomla hit it's peak use worldwide in 2009 and has declined continuously since then. The trend is the same for Drupal. But, although Joomla and Drupal are superior CMS applications, WordPress has continued to increase in usages. I believe this is due to the 'ease of use' of WordPress that almost anyone can install and manage it while Joomla and Drupal requires a bit more technical skills.

But I ain't changing....

Re: Consistent Date Format - Site and Administrator

Posted: Thu Jan 10, 2019 6:57 pm
by sozzled
LukeDouglas wrote:
Thu Jan 10, 2019 5:36 pm
In my research, I was really surprised that Joomla hit it's peak use worldwide in 2009 and has declined continuously since then.
Although off-topic here (and more appropriately discussed in The Lounge perhaps), I would be interested to see your research on the subject. Perhaps this is what you are referring to? >>> https://trends.google.com.au/trends/exp ... U&q=Joomla

Let's not discuss it here, though. 8)

Re: Consistent Date Format - Site and Administrator

Posted: Thu Jan 10, 2019 9:52 pm
by LukeDouglas