Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • ronneilan Friend
    #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 Friend
    #373252

    Do 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 Friend
    #373262

    /plugins/jat3/jat3/system/common.php is where you can find it and modify.

    Hope that helps.

    Phill Moderator
    #373267

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

    ronneilan Friend
    #373279

    I 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 v2

    gray Friend
    #373283

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

    thuanlq Friend
    #374164

    Hi@gray ,

    Thanks for your useful solution

Viewing 7 posts - 1 through 7 (of 7 total)

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