Easy Tutorial
❮ Event Onratechange Prop Optgroup Disabled ❯

JavaScript toLocaleTimeString() Method

JavaScript Date Object

Example

Convert the time portion of a Date object into a string based on local time:

n Output result:


Definition and Usage

The toLocaleTimeString() method converts the time portion of a Date object into a string based on local time and returns the result.


Browser Support

All major browsers support the toLocaleTimeString() method.


Syntax

Return Value

Type Description
String A string representation of the time portion of the date Object, represented in the local time zone and formatted according to local conventions.

Technical Details

| JavaScript Version: | 1.0 | | --- | --- |


JavaScript Date Object

❮ Event Onratechange Prop Optgroup Disabled ❯