test
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • nant Friend
    #147195

    Ja_teline III

    The last update date appear to always display in a format like:

    08:07:17 AM GMT

    Is there a way to change this to follow specific language?

    gray Friend
    #327957

    In templatesja_teline_iiilibsja.template.helper.p hp you can find function getLastUpdate()
    Line [php] return gmdate(“h:i:s A”, $sec+$tz).’ GMT’; [/php]
    defines format of the output.

    For example, the below code results in the output
    Last Update: 05 Dec 09:16 GMT
    [php] return gmdate(“d M G:i”, $sec+$tz).’ GMT’; [/php]

    See this post for more details, including if you get month not in English (setlocale would be required)

    nant Friend
    #328042

    Thanks for your reply.

    I looks at this function:

    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 ;
    }

    There appears to be something wrong with this.
    The line that returns the timezone of the viewer appears to always return null (even if a user is logged in at the moment).

    Can you please run this with your zend debugger on and verify this.

    It looks like the date will never be adjusted to GMT. Also, if a user is not logged in, then the timezone should be taken from the server settings.

    Unless I am missing something …

    Waiting for your feedback – thanks for all your replies so far 🙂

    Saguaros Moderator
    #328049

    Hello guy!

    The line that returns the timezone of the viewer appears to always return null , because the user did not set timezone, you can test with a account you change the timezone of the user, you’ll see the change of the date adjusting.

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

This topic contains 4 replies, has 3 voices, and was last updated by  Saguaros 14 years, 11 months ago.

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