Reputation: 21749
I am on VPS Clound hosting and the difference between MySQL SELECT NOW() and PHP date('Y-m-d H:i:s') is 4 hours. What is the problem?
Upvotes: 1
Views: 2086
Reputation: 360732
Time zones. One of the big three suspects (MySQL, Webserver, System) has a different TZ configuration than the others. One's probably defaulting to GMT/UTC, and the other's set to the server's local timezone.
Upvotes: 2
Reputation: 52372
PHP and MySQL are set to two different time zones. Both are configurable at the server- and individual execution/connection levels.
Upvotes: 3