title: Javascript set time string to date object
body: <p>Please see the below code;</p>
  
  <pre><code>var d = new Date();
  var s = "01.00 AM";
  d.setTime(s);
  </code></pre>
  
  <p>I know this code is wrong. Please give me the correct way to set the time. I have 12 hour time in string format in my hand.</p>
  
  <p><strong>The time will vary. Cannot know what will be the time earlier. Also it is 12 hour time. So it will be AM or PM</strong></p>