title: Convert date from UK GMT string to local date in JavaScript
body: <p>I have a situation where I am always returned the date from the server as a UK date time string.</p>
  <p>E.g. '2020-07-19 16:40:00'</p>
  <p>This would be 4:40PM in UK at +01:00, or 3:40PM UTC.</p>
  <p>I want to be able to convert this time from GMT to the local time on the computer;</p>
  <p>If I do this when in the UK...</p>
  <pre><code>var date = new Date('2020-06-19 16:40:00 GMT');
  </code></pre>
  <p>it returns <code>Fri Jun 19 2020 17:40:00 GMT+0100 (British Summer Time)</code></p>
  <p>Which is an hour out.</p>
  <p>If I do the date in winter time (without daylight savings), this is correct.</p>
  <pre><code>var date = new Date('2020-01-19 16:40:00 GMT');
  </code></pre>
  <p>returns <code>Sun Jan 19 2020 16:40:00 GMT+0000 (Greenwich Mean Time)</code></p>
  <p>Is there a way I can correctly adjust this to always give the correct time regardless of what timezone the computer is set in, based on UK clock times.</p>
  <p>Thanks in advance</p>