This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

toDateString

Summary

Returns the date component of a date as a human readable string.

Syntax

toDateString()

Return Value

String value containing the date, in the current time zone, in a convenient, human readable format, e.g. Fri May 09 2014

Examples

var date = new Date("2014-05-09");
console.log(date.toDateString());
// outputs: "Fri May 09 2014"

Notes

According to the specification the contents of the String are implementation-dependent. That means that you cannot rely on the returned format being consistent across browsers. That said, all major browsers seem to agree on the format Wed Oct 08 2014

See also

Other articles

External resources

Specification

Date.prototype.toDateString()

ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011

Attributions

  • Microsoft Developer Network: Article