Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript toDateString() Method

JavaScript toDateString() Method

Date Object Reference JavaScript Date object

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the toDateString() method.


Syntax

Date

.toDateString()

Return Value

Type Description
String The date is output as a string.

Date Object Reference JavaScript Date object