title: How to change Dates in HTML Table cells to Local Time with JavaScript?
body: <p>I'm not good in JavaScript.  Here is my html "Event Table" below with Date and Event Name: </p>
  
  <pre><code>&lt;table id="events"&gt;
      &lt;tr&gt;
          &lt;td&gt;23 Aug 20:00&lt;/td&gt;
          &lt;td&gt;Event 5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;23 Aug 18:30&lt;/td&gt;
          &lt;td&gt;Event 4&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;23 Aug 17:00&lt;/td&gt;
          &lt;td&gt;Event 3&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;22 Aug 13:45&lt;/td&gt;
          &lt;td&gt;Event 2&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Event 1&lt;/td&gt;
      &lt;/tr&gt;
   &lt;/table&gt; 
  </code></pre>
  
  <p>Dates are in GMT +2. I would like that these Event Dates be automatically converted to user's local time. Better if it is possible with "foreach", because the table consists of many rows.</p>
  
  <p>Solved, thanks to Answers, but maybe there is a more elegant way?</p>
  
  <pre><code>    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js"&gt;&lt;/script&gt;
  &lt;table id="events"&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;script&gt;var date1 = moment('23 Aug 20:00', 'D MMM HH:mm').utc();
  document.write(date1.format('D MMM HH:mm'));&lt;/script&gt;&lt;/td&gt;
          &lt;td&gt;Event 5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;script&gt;var date1 = moment('23 Aug 18:30', 'D MMM HH:mm').utc();
  document.write(date1.format('D MMM HH:mm'));&lt;/script&gt;&lt;/td&gt;
          &lt;td&gt;Event 4&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;script&gt;var date1 = moment('23 Aug 17:00', 'D MMM HH:mm').utc();
  document.write(date1.format('D MMM HH:mm'));&lt;/script&gt;&lt;/td&gt;
          &lt;td&gt;Event 3&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;script&gt;var date1 = moment('22 Aug 13:45', 'D MMM HH:mm').utc();
  document.write(date1.format('D MMM HH:mm'));&lt;/script&gt;&lt;/td&gt;
          &lt;td&gt;Event 2&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;script&gt;var date1 = moment('22 Aug 11:30', 'D MMM HH:mm').utc();
  document.write(date1.format('D MMM HH:mm'));&lt;/script&gt;&lt;/td&gt;
          &lt;td&gt;Event 1&lt;/td&gt;
      &lt;/tr&gt;
   &lt;/table&gt;
  </code></pre>