Phương thức toLocaleTimeString() trả về phần thời gian của Date theo định dạng locale của hệ điều hành.
Ví dụ
<html>
<head>
<title>JavaScript toLocaleTimeString Method</title>
</head>
<body>
<script>
var dt = new Date(2018, 0, 15, 14, 16, 30);
document.write("Formatted Time: " + dt.toLocaleTimeString());
</script>
</body>
</html>