JavaScript toDateString() Method
Example
Convert the date portion of a Date object into a readable string:
var d = new Date();
var n = d.toDateString();
n Result output:
Try it »
Definition and Usage
The toDateString() method converts the date portion of a Date object into a string and returns the result.
Browser support





All major browsers support the toDateString() method.
Syntax
Date
.toDateString()
Return Value
| Type | Description |
|---|---|
| String | The date is output as a string. |
JavaScript Date object