PHP Time Stamp Incorrect
It seems that since DST, the time stamps are out by an hour on 2 of my commerce web sites.
These are running PHP, so I assume it has something to do with date.timezone being set for UTC ?
The server time is correct, and I can offset the time stamp by an hour using the web site application, however, the web site generates customer order numbers based on the time, so even though the web site displays the correct time, the order numbers are still out by an hour.
Is there a setting other than UTC, where PHP will take it's time from the server, and preferably, something permanent, so that I don't have this issue again when the clocks change later in the year.
-
Hi - have you tried adding this to your php.ini? You'd want to make sure you use the correct time zone for your location, of course! [Date] ; Defines the default timezone used by the date functions date.timezone = America/New_York 0 -
After a little digging last night, i found that changing PHP config from UTC to Europe/London, fixed the time stamp issue. I'm not sure what will happen in October when the clocks go backwards though. I guess I'll address this later in the year. 0 -
your server time is synced to a NTP time server and the hour will be automatically adjusted when the clocks go +/- 1 hour 0 -
The clocks did adjust accordingly a few weeks ago, i assume that the issue was with PHP and UTC. It's this that i'm questioning 0 -
Hello, The date/time should automatically adjust based on the time server during daylight savings time events. Thank you. 0
Please sign in to leave a comment.
Comments
5 comments