JavaScript toTimeString () method
Examples
The time portion of the Date object is converted to a string:
var d=new Date();
var n=d.toTimeString();
var n=d.toTimeString();
n output:
try it"
Definition and Usage
toTimeString () method of the time part of a Date object converted to a string and returns the result.
Browser Support
All major browsers support toTimeString () method
grammar
Date.toTimeString()
Return Value
Type | 描述 |
---|---|
String | 时间作为字符串输出 |