JavaScript toDateString()Method

Date 对象参考手册JavaScript Date Object

Example

Converts the date part of a Date object into a readable string:

var d = new Date();
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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the toDateString() method


Syntax

Date.toDateString()

Return Value

Type Description
String Outputs the date as a string.


Date 对象参考手册JavaScript Date Object

Other Extensions