[eluser]Unknown[/eluser]
Im not sure about the host/server offset but it occurs both in my localhost and production server. And on the above code there is no part to get date/time from system, so I think offset is not affecting here. I checked the code of the function 'gmt_to_local' and 'convert_to_gmt' and I think the code of 'convert_to_gmt' has some problem. Here is the code of the date helper:
Code:
function convert_to_gmt($time = '', $timezone = 'UTC', $dst = FALSE)
{
if ($time == '')
{
return now();
}
$time -= timezones($timezone) * 3600;
if ($dst == TRUE)
{
$time += 3600;
}
return $time;
}
On dst calculation they are adding 3600 but I think it should be subtracted. 'gmt_to_local' is giving correct result but 'convert_to_gmt' is erroneous, Im guessing that. What do u think? Thanks for your valuable comment.