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.
我有一张桌子GMT timezone。现在我需要从不同的时区得到结果。
GMT timezone
如果我搜索日期04-02-2013 ,所有结果都将是 GMT 并且在转换到特定时区后它可能有05-02-2013.
04-02-2013
05-02-2013.
所以。04-02-2013我需要特定时区的确切日期结果。例如+5:30偏移量。(即在 之间GMT +5:30 and -5:30)
+5:30
GMT +5:30 and -5:30
如何在mysql中编写for。
尝试:
SELECT CONVERT_TZ(datefield,'US/Eastern','US/Central');
发现于:MySQL CONVERT_TZ()
查看mysql官方网站的这个页面
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_convert-tz