MySQL query for current GMT time
This sounds simple enough but I haven't been able to figure out how to use a simple SELECT statement to return the current time in GMT. I have been trying to use CONVERT_TZ() to convert NOW() to GMT based on the server time zone and the GMT time zone but for some reason it returns NULL when I put in the text time zones. The only way I get a result is to actually put in the offsets which is getting way too complicated for what should be a really simple operation. Here is what I mean: mysql> SELECT CONVERT_TZ(NOW(),@@global.system_time_zone,'GMT'); NULL mysql> SELECT CONVERT_TZ(NOW(),'PST','GMT'