Adding "0" if clock have one digit
let str = "34"
str = str.padStart(4, "0") // results in "0034"
console.log(str)
For Clock Example :
var now = new Date();
var year= now.getFullYear();
var month= (now.getMonth()+1).toString().padStart(2, "0");
var day= now.getDate().toString().padStart(2, "0");
var hour = now.getHours().toString().padStart(2, "0");
var minute = now.getMinutes().toString().padStart(2, "0");
document.getElementById("date").innerHTML =`${day}-${month}-${year}-${hour}:${minute}`;
<div id="date"></div>
Also in C++:
- git log with numbers
- echo variable referenced in variable
- git new branch
- composer uninstall
- copier un répertoire et son contenu sous linux
- how to set environment variable using bash
- update gitcmd
- git reset head
- install scratchpad jupyter notebook
- restart terminal command line ubuntu
- Adding "0" if clock have one digit
- add github repo
- ubuntu chang host name
- linux high load send mail
- linux basic commads
- ipython config location
- install reach router
- powershell connect to serial port
- unzip ubuntu
- bash rename files based on date modified
- clean npm cache
- ubuntu disable auto suspend command line
- curl command
- install eclipse in fedora