Convert the time portion of a Date object to a string:
The result of n will be:
The toTimeString() method converts the time portion of a Date object to a string.
![]()
The toTimeString() method is supported in all major browsers.
| Type | Description |
|---|---|
| String | The time as a string |
JavaScript Date Object
Your message has been sent to W3Schools.