Set timezone in PHP and MySQL
In PHP: <?php define(‘TIMEZONE’, ‘Europe/Paris’); date_default_timezone_set(TIMEZONE); For MySQL: <?php $now = new DateTime(); $mins = $now->getOffset() / 60; $sgn = ($mins < 0 ? -1 : 1); $mins = abs($mins); $hrs = floor($mins / 60); $mins -= $hrs * 60; $offset = sprintf(‘%+d:%02d’, $hrs*$sgn, $mins); //Your DB Connection – sample $db = new PDO(‘mysql:host=localhost;dbname=test’, ‘dbuser’, … Read more