Keyword

How do you change date format on earth?

  • shenkwen
  • shenkwen's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 11 months ago #59112 by shenkwen
How do you change date format on earth? was created by shenkwen
I've posted this yesterday, but no one cared to answer me, I really need a solution for this, so I have to post it again and try to describe it more particularly.

The date format displayed on my category items list view page is like this: "Wednesday, 19 October 2011 20:31". Through some searching, I've learned that the involved code to display date in Category_item.php is "<?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>", and to change the date format, I need to change the value of K2_DATE_FORMAT_LC2 in /language/en-GB/en-GB.com_k2.ini. The value was originally "%A, %d %B %Y %H:%M", everything until now seems on track. But no matter how I changed this value, the date displayed on my page just won't change at all.

Could anyone tell me what's wrong?

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #59113 by Robert Rosario
Replied by Robert Rosario on topic Re: How do you change date format on earth?
I've wanted to know the same thing. No updates about this as far as I know.

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #59114 by Simone Di Vincenzo
Replied by Simone Di Vincenzo on topic Re: How do you change date format on earth?
I have the same problem!

I tried to change K2_DATE_FORMAT_LC2 in language files and tried to modify something in category_item.php...but time format never change!

Can anyone answer??

In the whole forum I didn't find anything!

Please Help!

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #59115 by Simone Di Vincenzo
Replied by Simone Di Vincenzo on topic Re: How do you change date format on earth?
I guess it's a simple issue! Can anyone from the staff can answer?

Thanks

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #59116 by Dave
I now know the answer!!!

I too have been searching for the answer because the LC2 change had absolutely no effect.

I tweeted the K2Devs in the end and they pointed me in the right direction.

I was trying to change the language code manually (no effect) and also tried using the Joomla 2.5 Language Override function (gave a weird date format instead) but the Dev's said to look into the K2 language files to find out the difference. I couldn't see easily but I instead of the strfTime format with the % strings I used this format php.net/manual/en/function.date.php using the J2.5 override and it worked!!

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #59117 by Denise Montana
Replied by Denise Montana on topic Re: How do you change date format on earth?
Could you please post an example of the date string you wrote that worked? I'm not a PHP coder and don't understand exactly what to do.

Thank you.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #59118 by Denise Montana
Replied by Denise Montana on topic Re: How do you change date format on earth?
Never mind, I figured it out. I was making it too complicated.

For anyone else who's struggling, if you want a date like this:

Mon, Dec 10, 2012

set the override to:

D, M j, Y


No %, no $, no code -- just the format characters from php.net/manual/en/function.date.php

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #59119 by Dave
Great glad you worked it out! I was just about to reply :cheer:

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #59120 by lakeguy2302
Replied by lakeguy2302 on topic Re: How do you change date format on earth?
This did not work for me at all. it did nothing. i give up. Itis obviously unchageable.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #59121 by Dave
Are you using Joomla 2.5 or 1.5?

If you're using 2.5 have you tried using the supplied Language Override component to alter the date or did you edit the language php file manually?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum