Return the time portion of a Date object as a string, using locale conventions:
The result of n will be:
The toLocaleTimeString() method returns the time portion of a Date object as a string, using locale conventions.
![]()
The toLocaleTimeString() method is supported in all major browsers.
| Type | Description |
|---|---|
| String | The time as string |
| JavaScript Version: | 1.0 |
|---|
JavaScript Date Object
Your message has been sent to W3Schools.