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
- toString Method (Date)
- toGMTString Method (Date)
- toISOString Method (Date)
- toLocaleString Method (Date)
- toLocaleDateString Method (Date)
- toLocaleTimeString Method (Date)
- toTimeString Method (Date)
- toUTCString Method (Date)
External resources
Specification
ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011
Attributions
Microsoft Developer Network: Article