The Joomla! Forum ™



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.



Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Oct 26, 2006 2:15 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Oct 26, 2006 2:06 am
Posts: 6
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!


Top
 Profile  
 
PostPosted: Thu Oct 26, 2006 2:45 am 
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.


Top
  
 
PostPosted: Fri Nov 24, 2006 7:04 pm 
Joomla! Intern
Joomla! Intern

Joined: Wed Nov 15, 2006 7:33 pm
Posts: 69
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.


Top
 Profile  
 
PostPosted: Fri Nov 24, 2006 7:17 pm 
Joomla! Intern
Joomla! Intern

Joined: Wed Nov 15, 2006 7:33 pm
Posts: 69
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.


Top
 Profile  
 
PostPosted: Fri Nov 24, 2006 7:59 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Thu Aug 18, 2005 8:55 pm
Posts: 20036
Location: Nijmegen, The Netherlands
cronos916 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.


For the possible notations see PHP's strftime Command Format: http://php.net/manual/en/function.strftime.php

_________________
Kind Regards,
Peter Martin, Global Moderator - Community Leadership Team
http://www.db8.nl - Joomla specialist, Nijmegen, Nederland
Joomla 2.5 multilanguage in 10 steps: http://www.db8.nl/en/joomla-presentatio ... ge-website


Top
 Profile  
 
PostPosted: Sun Mar 02, 2008 11:00 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 02, 2008 10:52 pm
Posts: 25
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.


Top
 Profile  
 
PostPosted: Wed Apr 30, 2008 7:59 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Wed Nov 14, 2007 5:52 pm
Posts: 79
This was very helpful for me. Thanks!


Top
 Profile  
 
PostPosted: Sat May 03, 2008 4:02 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jun 27, 2007 2:47 pm
Posts: 15
Location: Glasgow
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 :(


Top
 Profile  
 
PostPosted: Mon Jun 02, 2008 7:55 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun May 18, 2008 1:43 am
Posts: 10
Excellent information on the en-gb.ini fix - thank you very much.


Top
 Profile  
 
PostPosted: Fri Jul 25, 2008 2:11 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu May 22, 2008 4:06 am
Posts: 3
Location: Lubbock, TX
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/option,com_mtree/task,viewlink/link_id,5341/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.

_________________
Professional Website Development
http://www.simplewebworks.com


Top
 Profile  
 
PostPosted: Mon Oct 13, 2008 8:23 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu Oct 02, 2008 2:15 am
Posts: 3
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


Top
 Profile  
 
PostPosted: Mon Jan 05, 2009 1:35 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Dec 29, 2008 2:11 pm
Posts: 7
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.


Top
 Profile  
 
PostPosted: Mon Jan 05, 2009 3:49 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu May 22, 2008 4:06 am
Posts: 3
Location: Lubbock, TX
Thanks Riavon for the correction. Glad you got it working.

_________________
Professional Website Development
http://www.simplewebworks.com


Top
 Profile  
 
PostPosted: Wed Jan 14, 2009 10:41 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jan 10, 2009 8:20 pm
Posts: 18
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) ?


Top
 Profile  
 
PostPosted: Sat Jan 17, 2009 11:25 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Dec 10, 2006 9:09 pm
Posts: 6
Any way to avoid having to change the date format each time you upgrade? ???


Top
 Profile  
 
PostPosted: Wed Jan 28, 2009 7:56 pm 
Joomla! Intern
Joomla! Intern

Joined: Wed Apr 11, 2007 1:01 pm
Posts: 61
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


Top
 Profile  
 
PostPosted: Fri Feb 06, 2009 6:04 am 
Joomla! Intern
Joomla! Intern

Joined: Wed May 24, 2006 1:51 pm
Posts: 63
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!


Top
 Profile  
 
PostPosted: Fri Mar 06, 2009 4:01 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Sun Oct 09, 2005 2:14 pm
Posts: 55
Location: Western Australia
Why is it that when I change my code to...

Code:
DATE_FORMAT_LC2=%e %B %Y


...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?


Top
 Profile  
 
PostPosted: Mon Apr 13, 2009 1:53 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Tue Aug 29, 2006 8:23 am
Posts: 148
Location: Mallorca - Spain
Quote:
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.

It's true on non-Windows platforms ;)
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:
      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


Top
 Profile  
 
PostPosted: Tue Apr 14, 2009 12:42 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Sun Oct 09, 2005 2:14 pm
Posts: 55
Location: Western Australia
Yes. Once I uploaded the site to the Linux host it worked fine. It was a a Windows specific error.


Top
 Profile  
 
PostPosted: Mon Apr 20, 2009 4:04 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Tue Aug 30, 2005 8:05 am
Posts: 53
Location: Virginia
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.


Top
 Profile  
 
PostPosted: Tue May 26, 2009 3:39 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Wed Oct 03, 2007 10:39 pm
Posts: 130
Bump...

Quote:
Is there a similar fix for the admin side?


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)

Image

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.


Top
 Profile  
 
PostPosted: Wed May 27, 2009 12:21 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Sun Oct 09, 2005 2:14 pm
Posts: 55
Location: Western Australia
Open the file administrator/language/en_GB/en_GB.ini. On about line 14 change the %d and %m elements around.

Code:
DATE_FORMAT_LC4=%m.%d.%y

The file path may not be "en_GB". Depends on your selected language.


Top
 Profile  
 
PostPosted: Wed May 27, 2009 3:50 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Wed Oct 03, 2007 10:39 pm
Posts: 130
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:
Quote:
DEFINE('_DATE_FORMAT_LC',"%m/%d/%Y"); //Uses PHP's strftime Command Format
DEFINE('_DATE_FORMAT_LC2',"%A, %B %d, %Y");


But that had no effect on the content items date in ADMIN.

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.


Top
 Profile  
 
PostPosted: Thu May 28, 2009 12:39 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Sun Oct 09, 2005 2:14 pm
Posts: 55
Location: Western Australia
Not sure if this includes the admin but try the guide on this page - http://www.welcometojoomla.com/how-do-i/date-format.html


Top
 Profile  
 
PostPosted: Thu May 28, 2009 3:11 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Wed Oct 03, 2007 10:39 pm
Posts: 130
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.


Top
 Profile  
 
PostPosted: Mon Jun 01, 2009 5:54 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat May 13, 2006 1:17 am
Posts: 16
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.


Top
 Profile  
 
PostPosted: Mon Jun 01, 2009 6:44 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Wed Oct 03, 2007 10:39 pm
Posts: 130
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

_________________
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.


Top
 Profile  
 
PostPosted: Mon Jul 13, 2009 12:44 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Apr 12, 2009 9:51 am
Posts: 15
ViperFish wrote:
Open the file administrator/language/en_GB/en_GB.ini. On about line 14 change the %d and %m elements around.

Code:
DATE_FORMAT_LC4=%m.%d.%y

The file path may not be "en_GB". Depends on your selected language.



Thanks for this, worked like a charm!


Top
 Profile  
 
PostPosted: Mon Jul 13, 2009 2:52 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Wed Oct 03, 2007 10:39 pm
Posts: 130
Anyone have any suggestions on how to do this for Joomla 1.0.15?

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2  Next



Who is online

Users browsing this forum: Google [Bot] and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group