My status

My backup memory

Thứ Hai, 3 tháng 6, 2013

How to change date format in Joomla?

Are you referring to the date format appearing as Thursday, 06 December 2012 and want it to appear as Thursday, December 6, 2012 ???

If so, log in to your sites backend and go to Extensions > Language Manager and click on the Overrides Tab. Click on the New button in the upper right. On the right hand side you have the option to do a search. Tick the Constant option and search for:

Code:
DATE_FORMAT_LC

You should now see the following results:

Code:
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

Clicking on the first result "DATE_FORMAT_LC" in the list will give you an option on the left hand side where you will see:

Code:
l, d F Y

Change that value to l, F j Y and click Save in the upper right.

Now repeat the process for:

DATE_FORMAT_LC1
DATE_FORMAT_LC2

Note that DATE_FORMAT_LC2 (the one that changes how dates are displayed in your articles such as "Published on" will have the the following:

Code:
l, d F Y H:i

Make sure you leave the H:i at the end of the line if you like to display the time an article was published.

For DATE_FORMAT_LC3 change it from:

Code:
d F Y

to become:
Code:
F d Y


For DATE_FORMAT_LC4 change it from:
Code:
Y-m-d

to:
Code:
m-d-Y


Note that you can change the above settings for both the frontend and backend at the same time as each have different language files. To accomplish this, when you go to make a new override before you click the New button make sure you have selected English - Administrator in the dropdown menu then click the New button in the upper right. You will have an option on the left called "For both locations".

More info on the standard PHP date formats can be found here:

http://php.net/manual/en/function.date.php

Source: http://forum.joomla.org/viewtopic.php?f=615&t=775861&hilit=+date#p2952166

Không có nhận xét nào:

Đăng nhận xét