Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何使用SELECT Now() As CurrentDateTimeGMT,因为它将书显示为 GMT-5。
SELECT Now() As CurrentDateTime
基本上,当时间是:2011-11-19 09:46:37在 GMT 中,它显示为:`2011-11-19 04:46:37
2011-11-19 09:46:37
`2011-11-19 04:46:37
我如何为 GMT 设置这个。
谢谢。
一种方法是为会话设置时区:
SET time_zone = '+00:00';
MySQL“时区支持”文档。
还有CONVERT_TZ,这里解释一下:MySQL default time format UTC or GMT?