Date toLocaleTimeString()
toLocaleTimeString() displays the date's hours, minutes, and seconds.
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<script type="text/javascript">
var aDate = new Date(Date.UTC(2021, 5, 4, 12, 21, 55));
document.writeln(aDate.toLocaleTimeString());
</script>
</head>
<body>
</body>
</html>