Hello guys,
After once again scratching my head I found again some funny things inside xcrud:
in xcrud.php, at the top, you'll see the default timezone set to:
I really don't know what was the idea with this but it messed up tons of functions in my code.
So to solve this I just reset it to UTC:
And then I've created a callback function that I use to modify mysql's UTC date to match whatever my timezone is.
example callback function:
simply called like that:
Hope it'll help if you get the same kind of funky behavior!
After once again scratching my head I found again some funny things inside xcrud:
in xcrud.php, at the top, you'll see the default timezone set to:
Code:
date_default_timezone_set('Africa/Nairobi');
I really don't know what was the idea with this but it messed up tons of functions in my code.
So to solve this I just reset it to UTC:
Code:
date_default_timezone_set('UTC');
And then I've created a callback function that I use to modify mysql's UTC date to match whatever my timezone is.
example callback function:
Code:
function display_correct_paris_time($value, $fieldname, $primary_key, $row, $xcrud_leads){
$correct_date_time = new DateTime($value, new DateTimeZone('UTC'));
$correct_date_time->setTimezone(new DateTimeZone('Europe/Paris'));
return $correct_date_time->format('Y-m-d H:i:s');
}
simply called like that:
Code:
$xcrud->column_callback('created_on', 'display_correct_paris_time');
$xcrud->field_callback('created_on', 'display_correct_paris_time');
Hope it'll help if you get the same kind of funky behavior!