JavaScript toTimeString() Method
Example
Convert the time portion of a Date object to a string:
var d = new Date();
var n = d.toTimeString();
Try it Yourself »
Definition and Usage
The toTimeString() method converts the time portion of a Date object to a string.
Browser Support
Method | |||||
---|---|---|---|---|---|
toTimeString() | Yes | Yes | Yes | Yes | Yes |
Syntax
Date.toTimeString()
Parameters
None |
Technical Details
Return Value: | A String, representing the time as a string |
---|
Related Pages
JavaScript Tutorial: JavaScript Dates
JavaScript Tutorial: JavaScript Date Formats
JavaScript Tutorial: JavaScript Strings
❮ JavaScript Date Object