JavaScript toDateString()Method
Example
Converts the date part of a Date object into a readable string:
var d = new Date();
var n = d.toDateString();
var n = d.toDateString();
nResult output:
Try it yourself »
Definition and Usage
The toDateString() method converts the date part 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 | Outputs the date as a string. |
Other Extensions
JavaScript Date Object