Easy Tutorial
❮ Event Target Prop Style Columnrule ❯

JavaScript toTimeString() Method

JavaScript Date Object

Example

Convert the time portion of a Date object to a string:

n Output result:


Definition and Usage

The toTimeString() method converts the time portion of a Date object to a string and returns the result.


Browser Support

All major browsers support the toTimeString() method.


Syntax


Return Value

Type Description
String Time output as a string

JavaScript Date Object

❮ Event Target Prop Style Columnrule ❯