test
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • issay Friend
    #169215

    my site’s date is wrong!! whats the problem. When I go to read the article I find the the correct date.month.year . but the problem is on top corner of the site now its 3 october 2011 . but my site says its 2 october 2011. global servr config is set to my local country.

    olso on janews pro time stamp i get an negetive day ago. i asked for help about this before. but the answer i got is not clear. iam using joomla 1.7 . what files i have to change to solve these problems?

    jooservices Friend
    #416348

    Hi , good morning
    May i ‘ve your site FTP / backend access for checking ?
    A screenshot with noted issue should be nice help me for faster working.
    Thank you
    Viet Vu

    gray Friend
    #416369

    Date is generated by the following block. PHP function date() is not corrected by the Joomla configs of time offset.

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

    Could you try simply adding at the beginning of /blocks/topbar.php for example:
    [PHP]echo date(‘l jS of F Y h:i:s A’);[/PHP]
    It will print out the current date and time of your server.

    jooservices Friend
    #418358

    Hi
    Thank @gray about extra information.
    Yes, we should use Joomla API ( JDate ) instead date() function ( PHP ).
    I’ll try to fw this issue to dev team.
    ps:// @issay: have you solved your issue?
    Thank you
    Viet Vu

    vipcory Friend
    #420371

    mine was fixed with this code:
    [PHP]<p class=”ja-day clearfix”>
    <?php
    echo “<span class=”day”>”.JText::_(strtoupper(JHTML::date(‘now’, ‘D’))).”</span>”;
    echo “<span class=”month”>”.JHTML::date(‘now’, ‘m’).”</span>”;
    echo “<span class=”date”>”.JHTML::date(‘now’, ‘d’).”</span>”;
    echo “<span class=”year”>”.JHTML::date(‘now’, ‘Y’).”</span>”;
    ?>
    </p>[/PHP]

    issay Friend
    #420389

    <blockquote>mine was fixed with this code:</blockquote>

    but this is not a real solution. because with this it will show ‘today’s date’ even if site is not updated for tha last month!! so its like a clock calender. I need to show last updated day. because i dont update my site every day. so i dont want to show a fake date.

    vipcory Friend
    #420392

    <em>@issay 277207 wrote:</em><blockquote>but this is not a real solution. because with this it will show ‘today’s date’ even if site is not updated for tha last month!! so its like a clock calender. I need to show last updated day. because i dont update my site every day. so i dont want to show a fake date.</blockquote>

    Oh ok, yea that part is meant to show only todays date, the time only is suppose to show that last updated time. So I guess someone needs to tweak that for you to show last update date.

    jooservices Friend
    #420395

    Hi
    I old post i’ve asked please give me for FTP access than i can help you.
    Btw, if you are asking datetime in article -> please use created time of article instead.
    But if you are talking currenttime .. time() is corrected.

    Thank you
    Viet Vu

    gray Friend
    #420408

    <em>@issay 277207 wrote:</em><blockquote>but this is not a real solution. because with this it will show ‘today’s date’ even if site is not updated for tha last month!! so its like a clock calender. I need to show last updated day. because i dont update my site every day. so i dont want to show a fake date.</blockquote>
    It depends what you want to fix. The above solution is for offsetting current date accroding to the server time offset.

    If you need to offset the “Last updated” time, find in T3 Freamework plugin’s file /common.php. In that file, find function getLastUpdate and replace it with the code below.
    [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]
    You can change $fieldname = ‘publish_up’; to $fieldname = ‘created’; if you’d like to show last time articles created, but not published.

    Then, in en-GB.plg_system_jat3.ini find T3_DATE_FORMAT_LASTUPDATE (3rd line) and set it to the format of date/time you need. For instance
    [php]T3_DATE_FORMAT_LASTUPDATE=”d.m.Y”[/php] will output “20.10.2011”
    [php]T3_DATE_FORMAT_LASTUPDATE=”d F Y”[/php] will output “20 October 2011”
    See format parameter here to alter the date/time output.

    Blaine Friend
    #428304

    Hi all!
    Can we mark this one solved now?
    Thanks!

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

This topic contains 10 replies, has 5 voices, and was last updated by  Blaine 13 years ago.

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