Can MySQL convert a stored UTC time to local timezone?

前端 未结 7 1295
被撕碎了的回忆
被撕碎了的回忆 2020-12-02 19:51

Can MySQL convert a stored UTC time to local time-zoned time directly in a normal select statement?

Let\'s say you have some data with a timestamp (UTC).



        
7条回答
  •  自闭症患者
    2020-12-02 20:15

    I propose to use

    SET time_zone = 'proper timezone';
    

    being done once right after connect to database. and after this all timestamps will be converted automatically when selecting them.

提交回复
热议问题