Javascript - Date toDateString() Method

The toDateString() method converts the date part of a Date object into a readable string.

Description

The toDateString() method converts the date part of a Date object into a readable string.

Syntax

Date.toDateString()

Return Value

A String, representing the date as a string

Example

Convert today's date into a readable string:

Demo

//display the date as a string.

var d = new Date();
var n = d.toDateString();
console.log(n);/*from   w w  w.ja  v a  2 s  .  com*/

Result