MySQL isn't going to know anything about your users' time zones. You'll need to get it with javascript or potentially PHP, though the best approach is often to just ask the user to select one. In that case, you can store their choice in the database, and then MySQL can know their time zone. You could then use convert_tz (or simply populate the offset you give to your ADDTIME
call). If you've set up your database with the time zone strings then you can store those and use them with convert_tz
, or you can still use convert_tz
with offsets by doing something like
SELECT * FROM {$this->burnsTable} WHERE DATE(CONVERT_TZ(created,'+00:00','+4:00')) = CURDATE();
You can join to the users table to do this, but instead of doing that on what could potentially be many queries it might be better to have the time zone stored in your PHP user model, and then just pass the appropriate offset instead of having to look it up each time.