Different PHP and MySQL date time -
i facing issue regarding date time returned php , mysql . checked php date, using
echo date("y-m-d h:m:s");
it returned
2013-07-31 01:07:37
then executed query in mysql console(phpmyadmin/sqlyog) query
select now() date_time
it resulted
2013-07-31 15:40:36
firslty want both should result dame date time, secondly how can set 1 of them match other one.
note: checked on local , live server both
apart typo in format codes, seems mysql , php not configured use same time zone. how find out?
mysql> select @@session.time_zone; +---------------------+ | @@session.time_zone | +---------------------+ | system | +---------------------+ 1 row in set (0.00 sec)
(in example, system
means "the time zone of host machine".)
<?php echo date_default_timezone_get(); // europe/madrid
Comments
Post a Comment