I have a column name serverUTC. I want to store UTC date time.I set the type is DATETIME and not null default CURRENT_TIMESTAMP. Please suggest me how I can store UTC date time
what is the correct format of a column for store UTC date time
196 views Asked by Supriya Roy At
1
MySQL store date in UTC but show (select) in your time zone. And if you insert date then convert to UTC before store.
You can use function UTC_TIMESTAMP() when selecting data or set/change default_time_zone.
More info and examples:
https://dba.stackexchange.com/questions/20217/mysql-set-utc-time-as-default-timestamp
https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.htm