How do I change my timezone which is currently in UTC to GMT +1, what is the correct line and do i just enter it in phpMyAdmin SQL execution?
My host just gave me this link http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html and went off so I'm kinda lost thanks
The easiest way to do this, as noted by Umar is, for example
Using the named timezone is important for timezone that has a daylights saving adjustment. However, for some linux builds you may get the following response:
If you're seeing this, you may need to run a tzinfo_to_sql translation... it's easy to do, but not obvious. From the linux command line type in:
Provide your root password (MySQL root, not Linux root) and it will load any definitions in your zoneinfo into mysql. You can then go back and run your
If SET time_zone or SET GLOBAL time_zone does not work, you can change as below:
Change timezone system, example: ubuntu... $ sudo dpkg-reconfigure tzdata
Restart the server or you can restart apache2 and mysql (/etc/init.d/mysql restart)
Here is how to synchronize PHP (>=5.3) and MySQL timezones per session and user settings. Put this where it runs when you need set and synchronized timezones.
Where $my_timezone is one in the list of PHP timezones: http://www.php.net/manual/en/timezones.php
The PHP timezone has to be converted into the hour and minute offset for MySQL. That's what lines 1-4 do.
This works fine
If you have the SUPER privilege, you can set the global server time zone value at runtime with this statement:
issue the command:
(Or whatever time zone GMT+1 is.: http://www.php.net/manual/en/timezones.php)
This is the command to set the MySQL timezone for an individual client, assuming that your clients are spread accross multiple time zones.
This command should be executed before every SQL command involving dates. If your queries go thru a class, then this is easy to implement.