JavaScript toDateString () method
Examples
The date portion of a Date object to a readable string:
var d = new Date();
var n = d.toDateString();
var n = d.toDateString();
n outputs the result:
try it"
Definition and Usage
toDateString () method to convert the date portion of a Date object to a string and returns the result.
Browser Support
All major browsers support toDateString () method
grammar
Date.toDateString()
return value
Type | 描述 |
---|---|
String | 日期作为字符串输出。 |