English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
toTimeString()The method returns the time part of the Date object in a human-readable form.
date.toTimeString()
var d = new Date(); var str = d.toTimeString(); document.getElementById('result').innerHTML = str;Test See‹/›
All browsers fully support the toTimeString() method:
Method | |||||
toTimeString() | Yes | Yes | Yes | Yes | Yes |
Return Value: | String representing the time part in a human-readable form |
---|---|
JavaScript Version: | ECMAScript 1 |