title: How can I convert a date to GMT?
body: <p>How to convert date of different timezones to GMT 0? Let say I have dates like this</p>
  
  <pre><code>Fri Jan 20 2012 11:51:36 GMT-0500
  Fri Jan 20 2012 11:51:36 GMT-0300
  Fri Jan 20 2012 11:51:36 GMT+0500
  </code></pre>
  
  <p>to </p>
  
  <pre><code>Fri Jan 20 2012 06:51:36 GMT
  Fri Jan 20 2012 08:51:36 GMT
  Fri Jan 20 2012 16:51:36 GMT
  </code></pre>
  
  <p>these are dates I am getting via <code>new Date().toString()</code> on different timezones. Is there any js method to detect timezone and convert accordingly?</p>
  
  <p>EDIT: The second three dates are not the GMT converted times of the first three. For example, <code>Fri Jan 20 2012 11:51:36 GMT-0500</code> in GMT is <code>Fri Jan 20 2012 16:51:36 GMT</code> not <code>Fri Jan 20 2012 06:51:36 GMT</code>. GMT-0500 is behind GMT, not ahead, so you have to add the offset to get GMT, not subtract it.</p>