Hi.
The Problem still occurrs.
I will describe what I could find out, maybe you have an idea what has been to be fixed:
Im using Joomla 1.5.4
First thing is: Joomla doesn't handle the time very well. It seems thqat joomla itself uses the linux timestamp or so. it doesn't use the php date() thingy! It cant. Because I have to set up in joomla currently UTC+2 (summertime) here for Germany so that all articles get the correct time. when it is winter, I have to set it UTC+1 and all articles written in summer are 1 hour "older"... okay that s**** but isnt really the problem of joomlacomment.
For a test I wrote a small php-script and uploaded it to my joomla docroot, named date.php ( if you like to test it too):
<html>
<head></head>
<body>
<?php
echo date("d-m-Y H:i:s");
echo "<br>";
echo date( "O" );
?>
</body>
</html>
It shows the date and Time and the UTC-offset that the webserver uses. Some webserver use UTC time not caring where they are located, there I guess they don't have this time-problem! But I set up my server running on local time and this is currently utc+2 and in winter utc+1. The time is updated by an ntp-server.
In joomla I have still to set the Timezone. So I guess (as said above) joomla doesnt use date() or just gets the timestamp, that is utc and recalculates the time with the offset-setting. I guess thats somehow okay because of compatibility to several php/server-Settings.
So now I also guessed !joomlacomment uses the date() function AND adds or deducts the offset extra. So as of on my server date() still provides the correct time, the addition of the offset is wrong.
So: If you like to do a workaround: Check with the above Script, if date() provides the current correct time. If so, you can do following:
open components/com_comment/joscomment/utils.php on Line 660 and 661 find:
global $mosConfig_offset;
return(date($format, strtotime($strdate)+($mosConfig_offset*60*60)));
and replace it with:
/*
global $mosConfig_offset;
return(date($format, strtotime($strdate)+($mosConfig_offset*60*60))); // if date provides correct time, so no offset needs to be added!
*/
return(date($format, strtotime($strdate)));
I'm used to leave the original code commented. Now I will take a look how joomla gets the time and possibly if it stores it in a variable that possibly !joomlacomment can get. So it could become more unified