这是表用户的简单版本:
+--------------+-------------------+
| id | timezone |
+--------------+-------------------+
| 1 | 'Europe/Helsinki' |
| 2 | 'Europe/Paris' |
+--------------+-------------------+
最佳答案
使用CONVERT_TZ:
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_convert-tz
原文链接:https://www.f2er.com/mysql/433430.htmlhttp://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_convert-tz
SELECT * FROM users WHERE hour(CONVERT_TZ(now(),server_tz,`timezone`))=16