Learn to Change How Dates Are Displayed on Your Joomla Site

0
9

When you first install Joomla on your server, you may notice that the date is in a European format, meaning that the day of the month precedes the name of the month like this – 03 December. In the US the date formats are generally displayed with the month first like this – December 03. You may also notice that the time of day is appended to many of the dates that are displayed on the Joomla site. Some people may not care, but if you do, or more importantly, you have a client that cares, you are going to want to change the default date settings on your Joomla site.

This article will explain how to change the date format on your Joomla site to US English and further explain how to alter the date display. I am assuming that you have Joomla installed and know how to access the administrator area. Also, you should have a good understanding of File Transfer Protocol (FTP) as you will have to access the site via FTP.

First, you will access the or directory of your Joomla installation and locate the "Language" directory, enter the directory and locate the "en-GB" directory and look for a file called "en-GB.ini" and copy it on to your hard drive. Now make another copy of it and put it in a safe place so that it can be used to replace the file you are working on if something should go wrong.

Next, open up en-GB.ini in a text editor, and search for "DATE_FORMAT_LC1" which will change article dates in categories and "DATE_FORMAT_LC2" which will change dates in articles. These are the two lines of code that you can alter within your site. Here is an explanation of what each symbol stands for:

A = Day of the Week
D = Day of the month, d is 2 number abbreviation for it as well
B = Month, b is three letter abbreviation for month
Y = Year, y is two number abbreviation for the year
H = Hours
M = Minutes

Note: These are case sensitive, so choose clearly based upon the previous symbol explanations.

When making changes to this document, you can experiment by moving the parameters around to your liking. Also, you can add commas or other symbols to the format as well.

As an example, if you have this format currently:
DATE_FORMAT_LC1 =% A,% d% B% Y – you will have a date that looks like this:
Thursday, 02 December 2009

If you change it to this:
DATE_FORMAT_LC1 =% A,% B% d% Y – you will see this:
Thursday, December 02, 2009

To make it cleaner, you can add a comma after the month like this:
DATE_FORMAT_LC1 =% A,% B% d,% Y – and it will look like this:
Thursday, December 02, 2009

If you want to add hours and / or minutes just add an% H and / or an% M to the format

Source

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.