I\'m currently attempting to display the user\'s time without displaying the seconds. Is there a way I can do this using Javascript\'s .toLocaleTimeString()?
Doing s
I think the original question can easily be answered with something being overlooked so far: a simple string split. The time being returned is a text string, just split it on the ":" delimiter and reassemble the string the way you want. No plug ins, no complicated scripting. and here ya go:
var myVar=setInterval(function(){myTimer()},1000);
function myTimer() {
var d = new Date();
currentNow = d.toLocaleTimeString();
nowArray = currentNow.split(':');
filteredNow = nowArray[0]+':'+nowArray[1];
document.getElementById("demo").innerHTML = filteredNow;
}