JavaScript Date toLocaleTimeString() Method

Definition and Usage

toLocaleTimeString() The method uses the locale settings convention to return the time part of the Date object as a string.

Example

Use the locale conventions to return the time part of the Date object as a string:

var d = new Date();
var n = d.toLocaleTimeString();

Try It Yourself

Syntax

Date.toLocaleTimeString()

Technical Details

Return Value: A string representing a date in string format.
JavaScript Version: ECMAScript 1

Browser Support

Method Chrome IE Firefox Safari Opera
toLocaleTimeString() Support Support Support Support Support

Related Pages

Tutorial:JavaScript Date

Tutorial:JavaScript Date Format

Tutorial:JavaScript String