English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript toTimeString() Method

 JavaScript Date Object

toTimeString()The method returns the time part of the Date object in a human-readable form.

Syntax:

date.toTimeString()
var d = new Date();
var str = d.toTimeString();
document.getElementById('result').innerHTML = str;
Test See‹/›

Browser Compatibility

All browsers fully support the toTimeString() method:

Method
toTimeString()YesYesYesYesYes

Technical Details

Return Value:String representing the time part in a human-readable form
JavaScript Version:ECMAScript 1

 JavaScript Date Object