How to Convert UTC Date To Local time Zone in MySql Select Query

SELECT CONVERT_TZ() will work for that.but its not working for me. Why, what error do you get? SELECT CONVERT_TZ(displaytime,’GMT’,’MET’); should work if your column type is timestamp, or date http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_convert-tz Test how this works: SELECT CONVERT_TZ(a_ad_display.displaytime,’+00:00′,’+04:00′); Check your timezone-table SELECT * FROM mysql.time_zone; SELECT * FROM mysql.time_zone_name; http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html If those tables are empty, you have … Read more

MySQL CONVERT_TZ()

If this yields null then the TZ tables have not been set up: SELECT CONVERT_TZ(now(),’US/Eastern’,’US/Central’); If you do not have the time zone tables set up you could update the hour offset in the user table and then do: select utc_timezone() – interval user_timezone_offset_in_hours hour from userinfo a where user_id = 999; You’d still need … Read more