Storing datetime as UTC in PHP/MySQL

Viewed 64726

Everywhere I read about converting time to a user's timezone says that the best method is to store a date and time in UTC then just add the user's timezone offset to this time.

How can I store a date in UTC time? I use the MySQL DATETIME field.

When adding a new record to MySQL in my PHP code I would use now() to insert into MySQL DATETIME.

Would I need to use something different than now() to store UTC time?

6 Answers
Related