-
AuthorPosts
-
matgray87 Friend
matgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
December 19, 2012 at 11:48 am #183249Hi,
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,
MattNinja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
December 20, 2012 at 4:42 am #476876That’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 Friendmatgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
December 20, 2012 at 12:21 pm #476941Hi, 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,
MattNinja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
December 21, 2012 at 3:47 am #477025This 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 Friendmatgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
December 21, 2012 at 12:06 pm #477084Hi, I’ve PM’d you… also, the ‘Last Updated’ at the top of the page has disappeared now too which is confusing!
Cheers,
MattNinja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
December 22, 2012 at 7:00 am #477161HI Matt,
I see the problem on your site. But I need to check code on your site, please pm me ftp account.
Regards
matgray87 Friendmatgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
December 22, 2012 at 12:13 pm #477208Hi,
I’ve PM’d you again with the ftp details.
Cheers,
MattNinja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
December 24, 2012 at 8:05 am #477375Because 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 Friendmatgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
December 24, 2012 at 2:08 pm #477410Hi,
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,
MattNinja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
December 25, 2012 at 4:18 am #477458I 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 Friendmatgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
December 26, 2012 at 2:14 pm #477564Hi,
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,
Mattmatgray87 Friendmatgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
December 26, 2012 at 2:25 pm #477565I’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,
MattNinja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
December 27, 2012 at 1:57 am #477595About $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 ArticleYou 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
1 user says Thank You to Ninja Lead for this useful post
-
AuthorPosts
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