-
AuthorPosts
-
January 23, 2011 at 1:42 am #159142
Can someone point me to the name and location of the php file in Teline III v 2 where I can change the time zone displayed at the top of the home page. I have found answers for Teline III v 1 and Teline IV but neither are correct for Teline III v2.
Update – thank you for your replies but no cigar. I am looking for a solution similar to the one at:
http://www.joomlart.com/forums/topic/how-to-change-last-update-from-gmt-to-est/gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
January 23, 2011 at 10:37 am #373252Do you mean “Last Update”?
Look at the alternative getLastUpdate function I developed. It takes into account the site time offset (or user’s time offset for those logged-in).splico123 Friendsplico123
- Join date:
- January 2007
- Posts:
- 339
- Downloads:
- 80
- Uploads:
- 7
- Thanks:
- 24
- Thanked:
- 93 times in 16 posts
January 23, 2011 at 11:33 am #373262/plugins/jat3/jat3/system/common.php is where you can find it and modify.
Hope that helps.
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
January 23, 2011 at 11:44 am #373267The actual part that displays the time in the template can be found in templates>ja_teline_iii_v2>blocks>header.php
Look for the code below
<p class="ja-updatetime"><span><?php echo JText::_('Last update')?></span><em><?php echo T3Common::getLastUpdate(); ?></em></p>
There are many mentions of changing that in the other threads as well as the suggestion by Gray above.
January 23, 2011 at 12:48 pm #373279I edited this php file but it didn’t change the outcome. I am looking for a solution similar to that at:
http://www.joomlart.com/forums/topic/how-to-change-last-update-from-gmt-to-est/
but for Teline III v2gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
January 23, 2011 at 2:28 pm #373283The original function getLastUpdate from /plugins/system/jat3/core/common.php looks like
[php]
function getLastUpdate(){
$db = &JFactory::getDBO();
$query = ‘SELECT created FROM #__content a ORDER BY created DESC LIMIT 1’;
$db->setQuery($query);
$data = $db->loadObject();
if( $data->created ){ //return gmdate( ‘h:i:s A’, strtotime($data->created) ) .’ GMT ‘;
$date =& JFactory::getDate(strtotime($data->created));
$user =& JFactory::getUser();
$tz = $user->getParam(‘timezone’);
$sec =$date->toUNIX(); //set the date time to second
return gmdate(“h:i:s A”, $sec+$tz).’ GMT’;
}
return ;
}
[/php]PHP gmdate() function, you see at the end, is identical to the date() function except that the time returned is Greenwich Mean Time (GMT).
So, you can put
[php]
return date(“h:i:s A”, $sec+$tz).’ EST’;
[/php]
But it’ll be not valid, if your server’s time is not EST. In this case you need to use time offset (as here) or date_default_timezone_set as in the example you pointed to.2 users say Thank You to gray for this useful post
-
AuthorPosts
This topic contains 7 replies, has 5 voices, and was last updated by thuanlq 13 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum