title: Convert a date string of format 'March 12 2019 9:30 am '+ given offset to browser timezone without using any libraries
body: <p>I am getting a date string in this format - 'March 12 2019 11:30 pm' and also the offset in hours like +5.5. I want to convert this date into my browser timezone.</p>
  
  <p>I have tried the following code</p>
  
  <pre><code>function convertToLocalTime(date, offset) {
    const serverTime = new Date(date);
    const localOffset = offset * 3600000;
    const d = new Date(serverTime.getTime() + localOffset).toUTCString();
    return new Date(d);
  }
  </code></pre>
  
  <p>But I am getting the date as <code>Tue Mar 12 2019 15:30:00 GMT+0530 (India Standard Time)</code> which is wrong.</p>
  
  <p>The expected result should be if the date is March 12 2019 11:30 pm and the offset given is -8 and my local time has an offset of +5.5, I should get the date as March 13 2019 12:00 pm.</p>
  
  <p><code>convertToLocalTime('March 12 2019 11:30 pm', -8)</code> 
  should give the date as March 13 2019 12:00 pm.</p>