I get invalid date while converting this string to datetime in javascript. Please help,
<p>Click the button to display the date.</p>
<p id="demo"></p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var a="9:00 PM";
var f= new Date(a.toString());
alert(f);
}
</script>