make minutes have 0 in javascript
String(date.getMinutes()).padStart(2, "0");
sets expected result as having two digits, if one is missing replace it with 0;
3.6
10
mins = ('0'+current_date.getMinutes()).slice(-2);
Thank you!
10
0
Are there any code examples left?
New code examples in category Javascript