title: MySQL query for current GMT time
body: <p>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.</p>
  
  <p>I have been trying to use <a href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_convert-tz" rel="noreferrer">CONVERT_TZ()</a> 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:</p>
  
  <pre><code>mysql&gt; SELECT CONVERT_TZ(NOW(),@@global.system_time_zone,'GMT');
  NULL
  
  mysql&gt; SELECT CONVERT_TZ(NOW(),'PST','GMT');
  NULL
  
  mysql&gt; SELECT CONVERT_TZ(NOW(),'-08:00','+00:00');
  2010-02-13 18:28:22
  </code></pre>
  
  <p>All I need is a simple query to return the current time in GMT. Thanks in advance for your help!</p>