My function returns the time like this 10:43:22
for example. How can I round the time to the closest minute so 10:43:22
becomes 10:43
and 10:43:44
becomes 10:44
.
function time (){
let date = new Date()
let time = date.toLocaleTimeString("it-IT");
}