title: converting date string to utc time format javascript
body: <p>i'm trying to convert this date string format "2014-12-04 12:00am" to a utc time with the format of "2014-11-29 01:00:12".</p>
  
  <p>i'm using this function </p>
  
  <pre><code> function formatDate(d){
            function addZero(n){
                return n &lt; 10 ? '0' + n : '' + n;
            }
  
            return d.getUTCFullYear() +"-"+ addZero(d.getUTCMonth()+1) + "-" +addZero(d.getUTCDate()) + " " +
                addZero(d.getUTCHours()) + ":" + addZero(d.getUTCMinutes()) + ":" + addZero(d.getUTCMinutes());
        } 
  </code></pre>
  
  <p>for some reason when i pick 12am it's set the val to a 12pm and i'm not sure this function is working on all the possibilities</p>