I can never seen to get my apps all running on the correct time. This usually messes up my stats, charts, and things of that nature. Here is how I got mine straightened out.
At the command line type the following to see the server time:
# date
Then to change that time to the correct time you want for the server type:
# date +%T -s "11:18:18"
Where
- 11: Hour (hh)
- 18: Minute (mm)
- 18: Second (ss)
Next check your my.cnf file which is usually located in /etc
Mine currently says this:
default-time-zone = ‘-07:00′
To be honest, it didn’t seem to work right away, but eventually after trying some numbers, it seems that -7 hours does the trick.
Last, I went into my php.ini file, also usually located in /etc and I checked the timezone there. I set mine to Los Angeles time.
date.timezone = America/Los_Angeles
Now the apps I use all show synced, correct time.
Server Time
PHP Time:
7/18/2011 11:15:15 AM |
MySQL Time:
7/18/2011 11:15:15 AM |