Welcome to Joomla!

John's tips to help you build a great, Joomla! powered website

How Do I Articles

How to change the Joomla date format

 

When Joomla is installed, it shows dates in a European format, and it includes the minute and time that an article is created.

For example, look at the date in the screen shot below:

faq-time-date-315

Depending on where in the world you are, you may want the dates to be in a different format.  Joomla can format them any way you want, but the date format is a bit hard to find in the "language file."

And, you cannot easily get to it from within Joomla itself, so that makes it a bit more difficult.

Here's how to change it.  Let's change the date to an American format, and let's drop the reference to the minute and second when the article is created.

Our goal is for the article date to look like this:  December 25, 2011

Since we cannot get to the "language" files from within a default Joomla installation, let's use an FTP program to access the files.

Note:  if you are working on your Joomla website on your own computer using a "localhost" approach, this is much easier.  You don't need to use an FTP program.  Just navigate to the proper folder in your computer's file system.

 

Start your FTP program and log into your website.  If you don't have an FTP program, I recommend FileZilla as a very good, free program.

 

Navigate to the following folder:

/language/en-GB

 

Now, look for the file titled en-GB.ini.   It is a plain text file, so you can edit that with a text editor.


Thsi will load the language file in your editor.  Joomla uses this file to keep the words and phrases that it uses, but it also keeps the date codes in there, too.

 

Scroll down until you see these lines:

fag-dateformat-1

 

You want to change this line a bit.   The %H:%M at the end refers to "show the hour and the minute."  We don't really need that on our site, so delete those codes.

So, now we have this:

DATE_FORMAT_LC2=%A, %d %B %Y

Next we will change the date format to the American format of "December 25, 2011"

So, let's switch the %d (which displays the date number) and the %B (which shows the month as a word.   And, let's add a comma (,) between the day and the year.

So, we now have

DATE_FORMAT_LC2=%A, %B %d, %Y

Save your changes (and be sure that they upload back to your webserver).

Check your site now (be sure to refresh the page to reload the latest changed.

You will see that the date format has changed to an American format.

faq-dateformat-done

 

To see a list of all of the date format options in php, go to this link: http://us2.php.net/strftime/.