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());
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…