-
AuthorPosts
-
September 26, 2011 at 2:51 am #168952
At the top lefthand side of the Teline IV template, the clock is three hours off of my actual time. I have verified that the server time is correct and the time zones are correct on both the server and the backend of Joomla. Anybody have any other suggestions?
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
September 26, 2011 at 11:06 am #415012Do you mean last update time?
I’ve done a hack of getLastUpdate function which correlates with the server time offset configured in Global configs.Find in jat3corecommon.php getLastUpdate function and replace it with:
[php]
function getLastUpdate($fieldname=null){
if (!$fieldname) $fieldname = ‘publish_up’;
$db = &JFactory::getDBO();
$query = “SELECT `$fieldname` FROM #__content a ORDER BY `$fieldname` DESC LIMIT 1”;
$db->setQuery($query);
$data = $db->loadObject();
if( $data->$fieldname ){
//return by the format defined in language file with server offset
return JHTML::date($data->$fieldname, JText::_(‘T3_DATE_FORMAT_LASTUPDATE’));
}
return;
}
[/php]Important: T3_DATE_FORMAT_LASTUPDATE – is the language string defined in en-GB.plg_system_jat3, for me it’s
T3_DATE_FORMAT_LASTUPDATE=”d.m.Y”
You can set other format in dependence to your preferences (see the format of PHP date)Also, the time shown is publish_up, not created. You can modify it in the 2nd row of the above function
if (!$fieldname) $fieldname = ‘publish_up’;September 26, 2011 at 12:34 pm #415026Actually it is the date that is just to the left of the last update section. I am not as concerned about the update time but the date that displays is sometimes (at the right time of day) shows the next day’s date. Granted, I am probably the only one who notices this at 11:00PM but it is still annoying to me.
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
September 26, 2011 at 12:48 pm #415027Ok, I understood.
That time (actually it’s date) is shown by the below piece of code in /blocks/topbar.php
[php]
<p class=”ja-day clearfix”>
<?php
echo “<span class=”day”>”.JText::_(strtoupper(date (‘D’))).”</span>”;
echo “<span class=”month”>”.date (‘m’).”</span>”;
echo “<span class=”date”>”.date (‘d’).”</span>”;
echo “<span class=”year”>”.date (‘Y’).”</span>”;
?>
</p>
[/php]PHP’s funciton date is based on server’s time. BUT make sure the server is located in your timezone – it could happen that it’s not located in your country – it this case adjust respectively the Joomla sever time offset.
Update:
Try replacing date(‘d’) etc. with
JHTML::date(time(), ‘d’);
and so on.1 user says Thank You to gray for this useful post
September 26, 2011 at 8:12 pm #415146The server is on our network and the time settings are correct. Just for giggles, I changed the time zone setting in Joomla to reflect three hours ahead. Unfortunately, I will not be able to see if the date changes until 9:01pm EST.
I’ll keep you posted.
-
AuthorPosts
This topic contains 5 replies, has 2 voices, and was last updated by mvadmin 13 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum