var date = "2012-01-18T16:03";
var date = new Date(date);
console.log(date.getMinutes());
console.log(date.getMinutes().length)
This returns 3.
- How do I make it return '03'?
- Why does
.length
return undefinded?
I tried this, but it did not work:
If strlen == 1
then num = ('0' + num);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…