A question I’ve seen come up from time to time is how do I set the correct timezone in Xampp!
Xampp is my tool of choice when
working with breaking WordPress. It’s incredibly intuitive and easy to install. You don’t even have to be a developer to find it useful. I often recommend it as a way of testing new functionality (such as plugins) prior to messing with your live blog. You can even use it to maintain a local copy of your live blog.
During the installation process you will be presented with various dialogue boxes. One such dialogue states that the timezone values in both
my.ini have been set to “America/Chicago” and that you should change them if they are not correct. The problem is you’re not told where you can easily find those files.
Before you do anything you’ll need the timezone information applicable to you. Head over to http://us2.php.net/manual/en/timezones.php where you will find a list of supported timezones divided by various geographic regions. I chose “America”. Then, you will be presented with a list of timezones under the heading “America”. I chose “America/Winnipeg” – select the one applicable to you.
Armed with that tidbit of information we can now make the necessary changes.
First, navigate to
C:\xampp\php\php.ini and open the file in a plain text editor such as Notepad. Look for the following …
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = "America/Chicago"
… and change “America/Chicago” to the proper value. In my case it is “America/Winnipeg”. Save the file and restart Apache (if it is running) in order for the change to take effect.
Next, navigate to
C:\xampp\mysql\bin\my.ini and open the file in a plain text editor such as Notepad. Look for the following …
default-time-zone = "America/Chicago"
… and again change the value to the one applicable to you. Save the file and restart MySQL (if it is running) in order for the change to take effect.