javascript - After converting the string date into a general time format, it is found that numbers less than 10 will not automatically add 0 in front, as follows
大家讲道理
2017-06-26 10:56:49
![](https://img.php.cn/upload/image/000/000/000/7982f78aa835af1e0b8f9e362807518d-0.png)
Do not use string splicing (less than 10, manually add 0 in front), are there any other methods?
Usually you don’t just write a JS paragraph to judge. If it’s less than 10, add a 0 in front