PDA

View Full Version : Changing default timezone in MYSQL.


mikethm
13-05-2007, 00:04
Hi I have a small problem. I am running mysql on windows xp apache. as the documentation on the mysql website is extremely unhelpful, I figure you guys should know the timezone setting for singapore. Seem that mysql doesn't work in GMT +/- format but some stupid PST EST nonsense instead... thus I am very confused as to what is the setting for our timezone.

Right now, my mysql installation system variable indicated it is set to SYSTEM TIME which mean it is taking the correct time BUT treating it as GMT time... so when a php script which allow users to set their own timezone... they set to "GMT +8" and the time would add like 8 hrs? to the existing global time and thus giving the wrong time to website visitors.

I would appreciate if anyone can tell me what to enter in the phpmyadmin query box to recify the situation... or what to add to my.ini file? terminal command is not possible in windows right?

tanfwc
13-05-2007, 00:36
How did you set the timezone?

If you want to set to a specific country or place, you must fill in a vaild timezone type.

http://www.tanfwc.com/ip-address

In the above tool, it will provide you the timezone that is required for most application because they simply cannot understand GMT +/-

Hope this helps. :)

mikethm
13-05-2007, 00:59
Thanks for the info. It was helpful. :)

tanfwc
13-05-2007, 01:53
No problem! You are most welcome.

hackerkts
05-06-2007, 02:07
http://www.tanfwc.com/ip-address


Just pointing out that on your site you only provides user proxy IP address and not the real external IP address, try this php script.
function get_ip()
{
if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP");
else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR");
else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR");
else $ip = "0.0.0.0"; //Unknown
return $ip;
}