Server time, not local user's time (php, mySQL)
Posted on 2012-03-24
A quick question:
Timezones around the world... users in different timezones.
I need to compare when a record was updated, not based on local time, but on server time.
I have a datetime field in mySql, default is: 0000-00-00 00:00:00
I have a form, and that form processing should update a field in a record. If someone in London and someone in Chicago update their record nearly simultaneously, the database should show the times as whatever was correct at the server at the time, not local time. Even though Peter and Paul are 6 hours apart in time zones, if they update nearly simultaneously, I would want:
2012-03-24 23:49:03 Peter, London
2012-03-24 23:49:00 Paul, Chicago
Will the php function Now() update the record with server time, or local time? If local, then what function do I need to use, instead.