How do I make MySQL's NOW() and CURDATE() functions use UTC?

后端 未结 7 970
闹比i
闹比i 2020-12-08 13:17

I want to make it so calls to NOW() and CURDATE() in MySQL queries return the date in UTC. How do I make this happen without going through and changing all queries that use

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-08 14:14

    You will need to use the SET TIMESTAMP statement to format the datetime results in the desired format. This will mean changing all those queries. sysdate() will not obey this though.

提交回复
热议问题