convert string to time javascript code example
Example 1: convert string time to time in javascript
alert (new Date (new Date().toDateString() + ' ' + '10:55'))
Example 2: convert string to datetime javascript
var s = '01-01-1970 00:03:44';
var d = new Date(s);
console.log(d); // ---> Thu Jan 01 1970 00:03:44 GMT-0500 (Eastern Standard Time)