title: Convert Python UTC time stamp to local time in JavaScript
body: <p>Im trying to convert a UTC timestamp generated with python to connecting clients local time. But, the time never converts correctly.</p>
  
  <p><strong>Python</strong></p>
  
  <pre><code>import time, datetime
  
  
  utc_time = datetime.datetime.utcnow()
  utc_time = int(time.mktime(utc_time.timetuple())) * 1000
  </code></pre>
  
  <p><strong>JavaScript</strong></p>
  
  <pre><code>function Time(time) {
      var month = {}
      month[0] = "Jan";
      month[1] = "Feb";
      month[2] = "Mar";
      month[3] = "Apr";
      month[4] = "May";
      month[5] = "Jun";
      month[6] = "Jul";
      month[7] = "Aug";
      month[8] = "Sept";
      month[9] = "Oct";
      month[10] = "Nov";
      month[11] = "Dec";
      day = {}
      day[0] = "Sunday";
      day[1] = "Monday";
      day[2] = "Tuesday";
      day[3] = "Wednesday";
      day[4] = "Thursday";
      day[5] = "Friday";
      day[6] = "Saturday";
      var b = new Date();
      var d = new Date(time);
      var c = d.getTime() + (b.getTimezoneOffset() * 60000);
      var offset = -(b.getTimezoneOffset() /60);
      var res = c + (3600000 * offset);
      d.setTime(res);
      var days = day[d.getDay()];
      var mon = d.getMonth();
      var year = d.getFullYear();
      var hour = d.getHours();
      var minute = d.getMinutes();
      var seconds = d.getSeconds();
      var date = d.getDate();
      return days + ' - ' + month[mon] + '/' + date + '/' + year + " - " + hour + ":" + minute + ":" + seconds;
  }
  console.log(Time(1429490580*1000)); 
  // time stamp generated: Sunday - Apr/19/2015  at 4:43PM
  </code></pre>
  
  <p>Is my math wrong or is it something I did wrong on the python side?</p>