How do you Change the Date format?
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
-
- Joomla! Apprentice
- Posts: 6
- Joined: Thu Oct 26, 2006 2:06 am
How do you Change the Date format?
I realize that this is an international product, the first of which I have ever used and I have been incredibly pleased, except I have come across one problem so far.
How do I change the current date format from day/month/year to month/day/year (the American format)
Its affecting all of my modules as well (I think). I have the locale set correctly (Eastern Time US, country locale is en_US)
I have tried and tried to change it in the language file, but it keeps resetting to the wrong format.
Its affecting the event calendar "upcoming events" calendar on the main page. Could it be a problem with that module?
Its confusing my users quite a bit and the sooner I can get it fixed the better
Thank you!
How do I change the current date format from day/month/year to month/day/year (the American format)
Its affecting all of my modules as well (I think). I have the locale set correctly (Eastern Time US, country locale is en_US)
I have tried and tried to change it in the language file, but it keeps resetting to the wrong format.
Its affecting the event calendar "upcoming events" calendar on the main page. Could it be a problem with that module?
Its confusing my users quite a bit and the sooner I can get it fixed the better
Thank you!
Re: How do you Change the Date format?
You will need to look in the language file under /languages/english[or whatever language your using].php
Look for:
/** templates/*.php */
DEFINE('_ISO','charset=iso-8859-1');
DEFINE('_DATE_FORMAT','l, F d Y'); //Uses PHP's DATE Command Format - Depreciated
/**
* Modify this line to reflect how you want the date to appear in your site
*
*e.g. DEFINE("_DATE_FORMAT_LC","%A, %d %B %Y %H:%M"); //Uses PHP's strftime Command Format
*/
DEFINE('_DATE_FORMAT_LC',"%A, %d %B %Y"); //Uses PHP's strftime Command Format
DEFINE('_DATE_FORMAT_LC2',"%A, %d %B %Y %H:%M");
and make the necessary alterations to have the date/time formatted as you wish.
Look for:
/** templates/*.php */
DEFINE('_ISO','charset=iso-8859-1');
DEFINE('_DATE_FORMAT','l, F d Y'); //Uses PHP's DATE Command Format - Depreciated
/**
* Modify this line to reflect how you want the date to appear in your site
*
*e.g. DEFINE("_DATE_FORMAT_LC","%A, %d %B %Y %H:%M"); //Uses PHP's strftime Command Format
*/
DEFINE('_DATE_FORMAT_LC',"%A, %d %B %Y"); //Uses PHP's strftime Command Format
DEFINE('_DATE_FORMAT_LC2',"%A, %d %B %Y %H:%M");
and make the necessary alterations to have the date/time formatted as you wish.
-
- Joomla! Intern
- Posts: 69
- Joined: Wed Nov 15, 2006 7:33 pm
Re: How do you Change the Date format?
Could you provide further detailed instructions for those PHP coding brain dead.
I have found that section in the file you specified, how does the code need to be modified. Sorry I understand html and css, but not php. YET.
I have found that section in the file you specified, how does the code need to be modified. Sorry I understand html and css, but not php. YET.
-
- Joomla! Intern
- Posts: 69
- Joined: Wed Nov 15, 2006 7:33 pm
Re: How do you Change the Date format?
ok, i think i was able to solve it so far. Did a quick google search. I understand how to change the date. What is the LC and LC2 stand for? I also noticed the date is only displayed correctly on the actual pages. It doesn't display correctly inside the admin areas.
- pe7er
- Joomla! Master
- Posts: 24929
- Joined: Thu Aug 18, 2005 8:55 pm
- Location: Nijmegen, Netherlands
- Contact:
Re: How do you Change the Date format?
For the possible notations see PHP's strftime Command Format: http://php.net/manual/en/function.strftime.phpcronos916 wrote:I have found that section in the file you specified, how does the code need to be modified. Sorry I understand html and css, but not php. YET.
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com
-
- Joomla! Apprentice
- Posts: 25
- Joined: Sun Mar 02, 2008 10:52 pm
Re: How do you Change the Date format?
How to do this using Joomla 1.5, assuming you want to change the default English:
1. Navigate to the language\en-GB folder in your Joomla install.
2. Edit the en-GB.ini file.
3. Change the date formats near the top. The parameters you see there (that is %A, %H, etc.) are replacements for the formatting of the date. The available parameters can be found in the PHP link in the above post.
An example for my particular setup, I wanted to switch to a format that looks like this for my front page articles.
Sunday, March 3 2008
I changed DATE_FORMAT_LC2 key to the parameters below to accomplish this:
DATE_FORMAT_LC2=%A, %B %d %Y
Reload the front page, and it was good to go.
Hope this helps.
1. Navigate to the language\en-GB folder in your Joomla install.
2. Edit the en-GB.ini file.
3. Change the date formats near the top. The parameters you see there (that is %A, %H, etc.) are replacements for the formatting of the date. The available parameters can be found in the PHP link in the above post.
An example for my particular setup, I wanted to switch to a format that looks like this for my front page articles.
Sunday, March 3 2008
I changed DATE_FORMAT_LC2 key to the parameters below to accomplish this:
DATE_FORMAT_LC2=%A, %B %d %Y
Reload the front page, and it was good to go.
Hope this helps.
- tomgreever
- Joomla! Intern
- Posts: 79
- Joined: Wed Nov 14, 2007 5:52 pm
Re: How do you Change the Date format?
This was very helpful for me. Thanks!
-
- Joomla! Apprentice
- Posts: 15
- Joined: Wed Jun 27, 2007 2:47 pm
- Location: Glasgow
Re: How do you Change the Date format?
I am not having any success with formatting date to the British way that is dd-mm-yyyy.
The code that I have modified is located at
includes/js/calendar/lang/calaendar-en.js
The section of the code that I have tried is as follows:
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-Y";
Calendar._TT["TT_DATE_FORMAT"] = "D, M d";
I have only edited the first line of the code. But no matter what I change it to, it still displays American date format ie yyyy-mm-dd.
Any help will be much appreciated. Sorry I am not a programmer.
wdsjpk
The code that I have modified is located at
includes/js/calendar/lang/calaendar-en.js
The section of the code that I have tried is as follows:
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-Y";
Calendar._TT["TT_DATE_FORMAT"] = "D, M d";
I have only edited the first line of the code. But no matter what I change it to, it still displays American date format ie yyyy-mm-dd.
Any help will be much appreciated. Sorry I am not a programmer.
wdsjpk
-
- Joomla! Apprentice
- Posts: 10
- Joined: Sun May 18, 2008 1:43 am
Re: How do you Change the Date format?
Excellent information on the en-gb.ini fix - thank you very much.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Thu May 22, 2008 4:06 am
- Location: Lubbock, TX
- Contact:
Re: How do you Change the Date format?
If you are trying to accomplish a standard US English format (Month Day Year) and you do not wish to manually change your language file and you are using Joomla! 1.5.3+ you might consider using Dave Morgan's American English translation language file found here: http://extensions.joomla.org/component/ ... Itemid,35/.
By installing that, you will see the American English version of the date (Month Day Year) displayed and this will prevent you from having to change your language files. Hope that helps. Thanks to Dave Morgan for the translation.
By installing that, you will see the American English version of the date (Month Day Year) displayed and this will prevent you from having to change your language files. Hope that helps. Thanks to Dave Morgan for the translation.
Professional Website Development
http://www.simplewebworks.com
http://www.simplewebworks.com
-
- Joomla! Fledgling
- Posts: 3
- Joined: Thu Oct 02, 2008 2:15 am
Re: How do you Change the Date format?
If you're using GCalendar,
Go to the module, then in the parameters put whatever you want from the table on GCalendar's website:
http://gcalendar.allon.ch/content/exten ... odule.html
Go to the module, then in the parameters put whatever you want from the table on GCalendar's website:
http://gcalendar.allon.ch/content/exten ... odule.html
-
- Joomla! Apprentice
- Posts: 7
- Joined: Mon Dec 29, 2008 2:11 pm
Re: How do you Change the Date format?
To "simplewebworks" - I installed that extension but nothing changed on my site, it still has the 'backwards' European date and time format, not the American date/time format. Guess we will have to just bite the bullet do it the hard way by re-coding the PHP file. Yikes.
[EDIT]: I stand corrected. What is not explained in the post is that once the simplewebworks extension is installed, you must take the additional step of logging into your language manager on your Joomla admin, then select the "English US" as the default. Then, it works beautifully. A simple "Once installed, set default to "English US" in language manager" would have been great.
Just wanted other American folks to know that the extension is, after all, a nifty solution to this date/time format problem.
[EDIT]: I stand corrected. What is not explained in the post is that once the simplewebworks extension is installed, you must take the additional step of logging into your language manager on your Joomla admin, then select the "English US" as the default. Then, it works beautifully. A simple "Once installed, set default to "English US" in language manager" would have been great.
Just wanted other American folks to know that the extension is, after all, a nifty solution to this date/time format problem.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Thu May 22, 2008 4:06 am
- Location: Lubbock, TX
- Contact:
Re: How do you Change the Date format?
Thanks Riavon for the correction. Glad you got it working.
Professional Website Development
http://www.simplewebworks.com
http://www.simplewebworks.com
-
- Joomla! Apprentice
- Posts: 18
- Joined: Sat Jan 10, 2009 8:20 pm
Re: How do you Change the Date format?
The extension works fine. But how do you get Joomla to knock it off with the two-digit day? (Jan 08, 2009 vs. Jan 8, 2009) ?
-
- Joomla! Apprentice
- Posts: 6
- Joined: Sun Dec 10, 2006 9:09 pm
Re: How do you Change the Date format?
Any way to avoid having to change the date format each time you upgrade?
-
- Joomla! Intern
- Posts: 61
- Joined: Wed Apr 11, 2007 1:01 pm
- Contact:
Re: How do you Change the Date format?
hi Guys
I may be missing something obvious but I am (desperately) trying to get the date from Sunday,10 January to Sunday, 10 Jan or Sun 10 Jan, that is to get my beloved joomla to start using abbreviated days and months. I installed the us language pack ´just fine and thats great but I cant figure out the php file since apparently thats where I need to go to get the short format I assume.
In short I am looking for Monday, January 05 2009
to display as Mon, Jan 5 2009
Thanks in advance for any help
Sami
-- ok figured it out, just need to find the right spot LC1 vs LC 2 etc
I may be missing something obvious but I am (desperately) trying to get the date from Sunday,10 January to Sunday, 10 Jan or Sun 10 Jan, that is to get my beloved joomla to start using abbreviated days and months. I installed the us language pack ´just fine and thats great but I cant figure out the php file since apparently thats where I need to go to get the short format I assume.
In short I am looking for Monday, January 05 2009
to display as Mon, Jan 5 2009
Thanks in advance for any help
Sami
-- ok figured it out, just need to find the right spot LC1 vs LC 2 etc
-
- Joomla! Intern
- Posts: 63
- Joined: Wed May 24, 2006 1:51 pm
Re: How do you Change the Date format?
Great - thanks. I wanted to remove the time stamp and just keep the date.
I changed mine in 1.5
DATE_FORMAT_LC2=%B %d, %Y
and it returns: November 10, 2008
Perfect!
I changed mine in 1.5
DATE_FORMAT_LC2=%B %d, %Y
and it returns: November 10, 2008
Perfect!
- ViperFish
- Joomla! Intern
- Posts: 67
- Joined: Sun Oct 09, 2005 2:14 pm
- Location: Western Australia
- Contact:
Re: How do you Change the Date format?
Why is it that when I change my code to...
...I can't get a date at all. Changing the %d to %e should remove the 0 padding before the day number ie 05 May becomes "5 may". According to PHP strftime functions, it's a valid format code. Does Joomla have it's own date formatting code hidden away somewhere?
Code: Select all
DATE_FORMAT_LC2=%e %B %Y
- dverger
- Joomla! Enthusiast
- Posts: 146
- Joined: Tue Aug 29, 2006 8:23 am
- Location: Mallorca - Spain
- Contact:
Re: How do you Change the Date format?
It's true on non-Windows platformsChanging the %d to %e should remove the 0 padding before the day number ie 05 May becomes "5 may". According to PHP strftime functions, it's a valid format code.
According to php.net Manual, %e will not work on Windows, some Linux distributions, and a few other operating systems.
Try adding this code to libraries\joomla\utilities\date.php, in _strftime function, just before $date = strftime($format, $time);
Code: Select all
if(strpos($format, '%e') !== false)
$format = str_replace('%e', date('j', $time), $format);
Damià Verger - Member of the Catalan Joomla Translation Team
Be Free
http://www.joomla.cat - JUG Països Catalans & Catalan Joomla TT
Be Free
http://www.joomla.cat - JUG Països Catalans & Catalan Joomla TT
- ViperFish
- Joomla! Intern
- Posts: 67
- Joined: Sun Oct 09, 2005 2:14 pm
- Location: Western Australia
- Contact:
Re: How do you Change the Date format?
Yes. Once I uploaded the site to the Linux host it worked fine. It was a a Windows specific error.
- mom2nine
- Joomla! Intern
- Posts: 53
- Joined: Tue Aug 30, 2005 8:05 am
- Location: Virginia
- Contact:
Re: How do you Change the Date format?
Is there a similar fix for the admin side? Currently the dates for articles in the article manager are displayed dd.mm.yy instead of mm.dd.yy. I know it's a silly little thing, but for me as an American it's always confusing to look at the list and figure out what day an item was posted.
- TheWebGuy
- Joomla! Enthusiast
- Posts: 135
- Joined: Wed Oct 03, 2007 10:39 pm
Re: How do you Change the Date format in Admin?
Bump...
I would just like to make the Dates "readable" for Content items as in Month-Day-Year.
Any Help is appreciated please.
Using Joomla 1.1.5
Thanks.
Would like the dates in Admin > Content to display as American type and changing the language file doesn't do it. Right now it displays as Day-Month-Year (see below)Is there a similar fix for the admin side?
I would just like to make the Dates "readable" for Content items as in Month-Day-Year.
Any Help is appreciated please.
Using Joomla 1.1.5
Thanks.
I know it's better to teach a man to fish...but if that man is starving, he'll die before he catches a fish. So do him a favor, feed him first...then teach him to fish.
- ViperFish
- Joomla! Intern
- Posts: 67
- Joined: Sun Oct 09, 2005 2:14 pm
- Location: Western Australia
- Contact:
Re: How do you Change the Date format?
Open the file administrator/language/en_GB/en_GB.ini. On about line 14 change the %d and %m elements around.
The file path may not be "en_GB". Depends on your selected language.
Code: Select all
DATE_FORMAT_LC4=%m.%d.%y
- TheWebGuy
- Joomla! Enthusiast
- Posts: 135
- Joined: Wed Oct 03, 2007 10:39 pm
Re: How do you Change the Date format?
Thanks for your response however I believe that it is for Joomla 1.5...
I am using Joomla 1.0.15 (sorry I missed posted the version above)
Do you know how to do this for v1.0.15?...in ADMIN
I changed the entries in the language/english.php to:
Thanks for the help with this.
I am using Joomla 1.0.15 (sorry I missed posted the version above)
Do you know how to do this for v1.0.15?...in ADMIN
I changed the entries in the language/english.php to:
But that had no effect on the content items date in ADMIN.DEFINE('_DATE_FORMAT_LC',"%m/%d/%Y"); //Uses PHP's strftime Command Format
DEFINE('_DATE_FORMAT_LC2',"%A, %B %d, %Y");
Thanks for the help with this.
I know it's better to teach a man to fish...but if that man is starving, he'll die before he catches a fish. So do him a favor, feed him first...then teach him to fish.
- ViperFish
- Joomla! Intern
- Posts: 67
- Joined: Sun Oct 09, 2005 2:14 pm
- Location: Western Australia
- Contact:
Re: How do you Change the Date format?
Not sure if this includes the admin but try the guide on this page - http://www.welcometojoomla.com/how-do-i ... ormat.html
- TheWebGuy
- Joomla! Enthusiast
- Posts: 135
- Joined: Wed Oct 03, 2007 10:39 pm
Re: How do you Change the Date format?
Thanks for the link, however that doesn't change the date as I would like in the backend ADMIN.
I know it's better to teach a man to fish...but if that man is starving, he'll die before he catches a fish. So do him a favor, feed him first...then teach him to fish.
-
- Joomla! Apprentice
- Posts: 19
- Joined: Sat May 13, 2006 1:17 am
Re: How do you Change the Date format?
it worked for me on the backend in joomla 1.5.10 by changing en en-GB.ini file in administrator/languages/en-GB to:
DATE_FORMAT_LC=%A, %B %e %Y
DATE_FORMAT_LC1=%A, %B %e %Y
DATE_FORMAT_LC2=%A, %B %e %Y %H:%M
DATE_FORMAT_LC3=%B %e %Y
DATE_FORMAT_LC4=%m/%d/%y
DATE_FORMAT_JS1=m-d-y
# %Y-%M-%D=%Y-%M-%D
%M-%D-%Y=%M-%D-%Y
%A, %B %E=%A, %B %e
note that the LC4 entry is the only one that mattered on the content dates.
DATE_FORMAT_LC=%A, %B %e %Y
DATE_FORMAT_LC1=%A, %B %e %Y
DATE_FORMAT_LC2=%A, %B %e %Y %H:%M
DATE_FORMAT_LC3=%B %e %Y
DATE_FORMAT_LC4=%m/%d/%y
DATE_FORMAT_JS1=m-d-y
# %Y-%M-%D=%Y-%M-%D
%M-%D-%Y=%M-%D-%Y
%A, %B %E=%A, %B %e
note that the LC4 entry is the only one that mattered on the content dates.
- TheWebGuy
- Joomla! Enthusiast
- Posts: 135
- Joined: Wed Oct 03, 2007 10:39 pm
Re: How do you Change the Date format?
Thanks for the reply.
Yes, I understand that your solution does work for Joomla 1.5 as I do run both versions 1.0.15 and 1.5.
However, it doesn't work for Joomla 1.0.15
Anyone have any suggestions for Joomla 1.0.15?
Thanks again,
Kevin
Yes, I understand that your solution does work for Joomla 1.5 as I do run both versions 1.0.15 and 1.5.
However, it doesn't work for Joomla 1.0.15
Anyone have any suggestions for Joomla 1.0.15?
Thanks again,
Kevin
I know it's better to teach a man to fish...but if that man is starving, he'll die before he catches a fish. So do him a favor, feed him first...then teach him to fish.
-
- Joomla! Apprentice
- Posts: 15
- Joined: Sun Apr 12, 2009 9:51 am
Re: How do you Change the Date format?
ViperFish wrote:Open the file administrator/language/en_GB/en_GB.ini. On about line 14 change the %d and %m elements around.
The file path may not be "en_GB". Depends on your selected language.Code: Select all
DATE_FORMAT_LC4=%m.%d.%y
Thanks for this, worked like a charm!
- TheWebGuy
- Joomla! Enthusiast
- Posts: 135
- Joined: Wed Oct 03, 2007 10:39 pm
Re: How do you Change the Date format?
Anyone have any suggestions on how to do this for Joomla 1.0.15?
TIA,
The Web Guy
TIA,
The Web Guy
I know it's better to teach a man to fish...but if that man is starving, he'll die before he catches a fish. So do him a favor, feed him first...then teach him to fish.