Recording the correct user's UTC time

After some testing, here is our findings:

TIMESTAMP in DB Insert inserts 0s (whether field type be DATE or DATETIME)
NOW and NOW_UTC insert the server’s time, not the user’s UTC.
Function toLocalTime doesn’t change the date/time.
Function toUTCTime gives error “Class ‘lib\core\DateTimeZone’ not found

DB: MySQL
PHP version: 7.3.6

Anyone can advise how to make sure the user’s UTC is inserted in the DB? Thanks.

Community Page
Last updated: