I have dynamic string with a HH:mm:ss
format (e.g. 18:19:02
). How can the string be converted into a JavaScript Date object (in Internet Explorer 8, Chrome, and Firefox)?
I tried the following:
var d = Date.parse("18:19:02");
document.write(d.getMinutes() + ":" + d.getSeconds());