English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
toLocaleTimeString()Method returns a string representing the time part of the date object, which is associated with the system's locale setting (locality sensitive).
date.toLocaleTimeString()
var d = new Date(); var str = d.toLocaleTimeString(); document.getElementById('result').innerHTML = str;Test See‹/›
All browsers fully support the toLocaleTimeString() method:
Method | |||||
toLocaleTimeString() | Yes | Yes | Yes | Yes | Yes |
Return Value: | A string, represented according to the conventions of the operating system's locale setting for the 'time' part |
---|---|
JavaScript Version: | ECMAScript 1 |