Write a JavaScript program to implement digital clock using JavaScript timer.
<html>
<head>
<title>setInterval() demo</title>
</head>
<body onload="setInterval(callTimer, 1000);">
<p id="demo"></p>
<script>
function callTimer() {
document.getElementById('demo').innerHTML = new Date().toLocaleString();
}
</script>
</body>
</html>
