Home about IT Motivation Course Sales Project About Me

Monday, June 11, 2012

timezone mysql & PHP not correct

To see what timezone your MySQL session is using, just execute this:
SELECT @@global.time_zone, @@session.time_zone;

to changes timezone, run below script: use super previlage
mysql> SET GLOBAL time_zone = 'America/New_York';
 or 
mysql> SET GLOBAL time_zone = 'Asia/Krasnoyarsk'; 
 
to check your date correct, use this:
select date(now());
or 
select curdate();
 
for php, please go to php.ini then edit below:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "America/Los_Angeles"

; http://php.net/date.default-latitude
;date.default_latitude = 31.7667 
 
changes : America/Los_Angeles --> Asia/Seoul 
 

 


No comments: