0
How is output "0" before 0,1,2,3...9
6 ответов
+ 4
Learning to google is a fantastic tool 😉
https://stackoverflow.com/questions/8043026/how-to-format-numbers-by-prepending-0-to-single-digit-numbers
+ 1
it's showing me right time ,not sure what you are talking about
+ 1
If your intention is only to show the current time then I think the following would suffice:
document.write(minutes.toString().padStart(2, "0"))
0
Abhay, when the time shows 23:05, JavaScript is output 25:5
0
How to do that JavaScript is output 23:05 instead of 23:5
0
If (hours<10){
hours = "0"+hours ;
}
similarily for minutes