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

    Do 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’;

    mvadmin Friend
    #415026

    Actually 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 Friend
    #415027

    Ok, 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.

    mvadmin Friend
    #415146

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

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

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