Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • splico123 Friend
    #159139

    Hey guys, just a question if anyone is interested in solving this, i have been using a hack for the time for latest update and i want following:

    in the latest update i want to show the date (d m Y) and Time (H:i) for my latest MODIFIED article.

    the problem is that i want to use server time which shows correctly on modified date under certain article but on front page it shows UTC time which is -1hour for me… timezone in Joomla config has been set to +1 and article modified dates show correctly just on frontend it shows it still in GMT.

    can anyone solve this?

    EDIT: No answer yet from anyone?

    splico123 Friend
    #373588

    Ayone did this yet?

    Ninja Lead Moderator
    #373817

    dear,

    could you be more specific about on what module the issue occur? and please provide your site link.

    RParks Friend
    #374713

    if i understand correctly, this person wants the Last update box in the upper left area to show in his local time as opposed to GMT. i have the same problem. i have set my global config to EST, but the Last update time still shows as GMT. did anyone figure this out? see attached.

    thanks.

    <em>@splico123 216834 wrote:</em><blockquote>Hey guys, just a question if anyone is interested in solving this, i have been using a hack for the time for latest update and i want following:

    in the latest update i want to show the date (d m Y) and Time (H:i) for my latest MODIFIED article.

    the problem is that i want to use server time which shows correctly on modified date under certain article but on front page it shows UTC time which is -1hour for me… timezone in Joomla config has been set to +1 and article modified dates show correctly just on frontend it shows it still in GMT.

    can anyone solve this?

    EDIT: No answer yet from anyone?</blockquote>


    1. lastupdate_screenshot
    Saguaros Moderator
    #375553

    <em>@RParks 218830 wrote:</em><blockquote>if i understand correctly, this person wants the Last update box in the upper left area to show in his local time as opposed to GMT. i have the same problem. i have set my global config to EST, but the Last update time still shows as GMT. did anyone figure this out? see attached.

    thanks.

    </blockquote>

    Ok, you need make a customization to resolve the issue:

    1) open the file: pluginssystemjat3corecommon.php and find the following code:

    [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]

    replace:

    [PHP]

    function getLastUpdate(){
    $db = &JFactory::getDBO();
    $config = &JFactory::getConfig();
    $offset = $config->getValue(‘config.offset’);
    $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));
    $sec =$date->toUNIX(); //set the date time to second
    return gmdate(“h:i:s A”, $sec+$offset).’ GMT’;
    }
    return ;
    }
    [/PHP]

    2) when done you access the global configuration to change your timezone

    THanks

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

This topic contains 5 replies, has 4 voices, and was last updated by  Saguaros 13 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum