title: Getting timezone for JavaScript and PHP all mixed up
body: <p>I'm trying to synchronize the timezone between a PHP script and some JavaScript code.</p>
  
  <p>I want a PHP function that returns a timestamp in UTC. Does <a href="http://php.net/manual/en/function.gmmktime.php" rel="nofollow noreferrer">gmmktime()</a> do that?</p>
  
  <p>On the JavaScript side, I have:</p>
  
  <pre><code>var real_date = new Date();
  real_date    -= real_date.getTimezoneOffset() * 60000;
  real_date    /= 1000;
  </code></pre>
  
  <p>Does this convert the timestamp to UTC?</p>