Returns a date as a string value appropriate to the host environment’s current locale.
var nowdate = new Date(); alert(nowdate.toLocaleString()); // output: "Tuesday, November 04, 2014 11:34:06 AM"
String that contains a date, in the current time zone, in a human readable format. The date is in the default format of the host environment’s current locale.
The return value of toLocaleString cannot be relied upon in scripting, as it will vary from computer to computer. The toLocaleString method should only be used to format display - never as part of a computation.
- toString Method (Date)
- toDateString Method (Date)
- toGMTString Method (Date)
- toISOString Method (Date)
- toLocaleDateString Method (Date)
- toLocaleTimeString Method (Date)
- toTimeString Method (Date)
- toUTCString Method (Date)
ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011