test
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • matgray87 Friend
    #183249

    Hi,

    As soon as I publish an article, it shows in JA News Pro and JA Bulletin as Published 1 Hour Ago…

    My TimeZone is correct, and the date created / time saved within the article is correct… it’s only displaying wrong in News/Bulletin.

    I’m not sure if this is to do with Daylight Saving or something, but surely it should take the time from the article anyways?

    Can someone let me know what I need to do to correct this?

    Many thanks,
    Matt

    Ninja Lead Moderator
    #476876

    That’s right, because JA Bulletin Module and JA News Pro get time from created time and you would like to change them to published time, right? Let me know if i can help you

    matgray87 Friend
    #476941

    Hi, nope – I need it to stay as the created time… but the created time is still off by an hour… if I manually change the create date within the article to an hour forwards, the time then shows correctly on the News Pro and Bulletin, but wrong in the article.

    Cheers,
    Matt

    Ninja Lead Moderator
    #477025

    This is so weird since I just checked on both module, they are get “CreateDate” as same time with “CreateDate” of article. If possible you can pm me with url and admin access your site, I shall check it directly on your site

    matgray87 Friend
    #477084

    Hi, I’ve PM’d you… also, the ‘Last Updated’ at the top of the page has disappeared now too which is confusing!

    Cheers,
    Matt

    Ninja Lead Moderator
    #477161

    HI Matt,

    I see the problem on your site. But I need to check code on your site, please pm me ftp account.

    Regards

    matgray87 Friend
    #477208

    Hi,

    I’ve PM’d you again with the ftp details.

    Cheers,
    Matt

    Ninja Lead Moderator
    #477375

    Because time zone on your site was incorrect, you need to contact with system administrator on your hosting set it on php.ini file

    By now, I have fixed the problem on your site by adding php code with format

    <blockquote>ini_set(‘date.timezone’, ‘Europe/Berlin’);</blockquote>

    Please check it on your site

    matgray87 Friend
    #477410

    Hi,

    Thanks for that… I’ve just tried adding a new article, and still the timestamp is appearing wrong – it’s still out by an hour 🙁
    I’ve cleared all my cache etc, but to no avail. Where have you added that piece of code?

    Thanks again,
    Matt

    Ninja Lead Moderator
    #477458

    I have added this format on index.php to your root site. But just removed it now, I have tracked your site put to “Europe/Berlin”, right?

    I checked currently time on your site with “current time berlin germany” as the same. Let me know if i missed.

    matgray87 Friend
    #477564

    Hi,

    It’s Europe/London where we are…

    I’ve added ini_set(‘date.timezone’, ‘Europe/London’); to the bottom of index.php, but it still doesn’t show right?

    I’m using .htaccess to remove index.php – will that make a difference?

    Thanks,
    Matt

    matgray87 Friend
    #477565

    I’ve managed to fix it by changing helper.php, line 209:

    function generatTimeStamp($date_data)
    {
    $timeStamp = strtotime($date_data);
    $Time_Left = (time() - $timeStamp -3600);

    $d = floor($Time_Left / 24 / 60 / 60);
    $Time_Left = $Time_Left % (60 * 60 * 24);
    $h = floor($Time_Left / 60 / 60);
    $Time_Left = $Time_Left % (60 * 60);
    $m = floor($Time_Left / 60);

    if ($d == 0) {
    if ($h > 1)
    $str = $h . ' ' . JText::_('HOURS') . ' ' . JText::_('AGO');
    elseif ($h == 1)
    $str = $h . ' ' . JText::_('HOUR') . ' ' . JText::_('AGO');
    elseif ($m < 2)
    $str = $m . ' ' . JText::_('MIN') . ' ' . JText::_('AGO');
    else
    $str = $m . ' ' . JText::_('MINS') . ' ' . JText::_('AGO');
    } elseif ($d == 1)
    $str = $d . ' ' . JText::_('DAY') . ' ' . JText::_('AGO');
    elseif ($d < 30)
    $str = $d . ' ' . JText::_('DAYS') . ' ' . JText::_('AGO');
    elseif ($d == 30)
    $str = '1 ' . JText::_('MONTH') . ' ' . JText::_('AGO');
    else {
    $months = floor($d / 30);
    $years = floor($months / 12);
    if ($months < 12)
    $str = $months . ' ' . JText::_('MONTHS') . ' ' . JText::_('AGO');
    elseif ($months == 12)
    $str = $years . ' ' . JText::_('YEAR') . ' ' . JText::_('AGO');
    elseif ($years < 2)
    $str = $years . ' ' . JText::_('YEAR') . ' ' . JText::_('AGO');
    else
    $str = $years . ' ' . JText::_('YEARS') . ' ' . JText::_('AGO');
    }

    return $str;
    }

    I added ‘-3600’ to offset it by an hour, but it only seems like a temporary fix, not a solution…

    What do you suggest?

    Cheers,
    Matt

    Ninja Lead Moderator
    #477595

    About $Time_Left = (time() – $timeStamp -3600);: This is not correct solution because this problem is not here

    time(): This is currently time on your server but it is always to delay an hour with real currently time
    $timeStamp: This is datetime from CreateDate of Article

    You need to contact with system administrator on your hosting to check Time Zone configure on php.ini from hosting server

    If you are developer you can test this script below

    echo date('l jS of F Y h:i:s A'); <- on your server was delay an hour with real time

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

This topic contains 13 replies, has 2 voices, and was last updated by  Ninja Lead 12 years ago.

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