RsD0p9BK
2/17/2017 - 9:43 AM

pdo__time_zone.php

// Changing time zone after connecting to database

$pdo = new PDO('mysql:host=localhost;dbname=exampletable', 
               'exampleuser', 
               'examplepassw', 
               [PDO::MYSQL_ATTR_INIT_COMMAND =>"SET NAMES utf8;SET time_zone = 'Europe/London'"]);
               
// http://stackoverflow.com/questions/24560881/changing-time-zone-after-connecting-to-database-using-set-time-zone