title: How do I get a UTC Timestamp in JavaScript?
body: <p>While writing a web application, it makes sense to store (server side) <em>all</em> datetimes in the DB as UTC timestamps.</p>
  
  <p>I was astonished when I noticed that you couldn't natively do much in terms of Timezone manipulation in JavaScript.</p>
  
  <p>I extended the Date object a little. Does this function make sense? Basically, every time I send anything to the server, it's going to be a timestamp formatted with this function...</p>
  
  <p>Can you see any major problems here? Or maybe a solution from a different angle?</p>
  
  <pre><code>Date.prototype.getUTCTime = function(){ 
    return new Date(
      this.getUTCFullYear(),
      this.getUTCMonth(),
      this.getUTCDate(),
      this.getUTCHours(),
      this.getUTCMinutes(), 
      this.getUTCSeconds()
    ).getTime(); 
  }
  </code></pre>
  
  <p>It just seems a little convoluted to me. And I am not so sure about performance either.</p>