I have a very strange problem that I can’t wrap my head around… I have a PHP file which outputs this:
date(‘Y-m-d H:i:s’, time())
And it outputs the correct datetime. Then I try to save this into a MySQL datetime field (using WordPress DB API, not that it matters) – but the time recorded in the database is two hours off! For example, it will say 2011-07-09 09:00:57, when it’s supposed to be 2011-07-09 11:00:57.
Is there some separate time settings for mySQL or something that could cause this to happen? Can anyone think of reasons this might happen, and I will investigate it. I don’t know what to look for right now.
log in your wp admin. then goto Settings > General.Then you can change Timezone settings