How to change the data format in articles

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed Jul 17, 2013 12:28 pm
Reply with quote
Report this post
I tried to change the date format of the articles but for some reason I didn't succeed. I want to use the dd.mm.yyyy. format since I can't use the words in dates in croatian because of the variations. What is the proper code to use? Which files do I need to edit the hr-HR.ini file in language or the hr-HR.com_K2.ini file or both?

thank you
User avatar
Senior Boarder

GK User
Wed Jul 17, 2013 5:21 pm
Reply with quote
Report this post
Hi, I suggest in both. Because never know when you use K2 items or Joomla articles.

For K2 items search in .ini for:
Code: Select all
K2_DATE_FORMAT="%d/%m/%Y - %H:%M"
K2_DATE_FORMAT_LC2="%A, %d %B %Y %H:%M"
K2_DATE_FORMAT_LC="%A, %d %B %Y"



Read also here: http://jbeginner.com/tutorials/extensio ... date-time/
User avatar
Platinum Boarder

GK User
Wed Jul 17, 2013 5:28 pm
Reply with quote
Report this post
But sometimes you have to search & change in .php files, for example, templates\gk_magazine\html\com_k2\templates\default\item.php

Code: Select all
<time datetime="<?php echo JHtml::_('date', $this->item->created, JText::_(DATE_W3C)); ?>"> <?php echo JHTML::_('date', $this->item->created, JText::_('F j, Y')); ?> </time>
User avatar
Platinum Boarder

GK User
Wed Jul 17, 2013 11:19 pm
Reply with quote
Report this post
that's it, changing the both ini files didn't help but now I finally managed to change the date format by editing the php file. just great :)
User avatar
Senior Boarder


cron