2.1.43 [ECMA-262/5] Section 220.127.116.11, Date.prototype.toLocaleString ()
This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment’s current locale.
IE9 Mode, IE10 Mode, IE11 Mode, and EdgeHTML Mode (All Versions)
The returned String value is determined from the following steps:
Using the system locale settings, get the local time value that corresponds to the date value. Apply any appropriate civil time adjustments.
If the year of Result(1) is less than or equal 1600 or is greater than or equal to 10000, return the result of calling the standard built-in Date.prototype.toString method with Result(1) as its this object.
Use the GetDateFormat Microsoft Windows system function (http://msdn.microsoft.com/en-us/library/dd318086(VS.85).aspx), to format the date and time that correspond to Result(1). Pass the default value of
DATE_LONGDATEfor format flags. However, if the current locale’s language is Arabic or Hebrew, pass the value
DATE_LONGDATE | Date_RTLREADINGfor format flags.
If the call in step 3 fails and the current locale language is Hebrew, throw a RangeError exception.
Use the GetTimeFormat Windows system function (http://msdn.microsoft.com/en-us/library/dd318130(VS.85).aspx) to format the date and time that correspond to Result(1). Pass the default value of zero for format flags.
If the calls in steps 3 or 5 fail, return the result of calling the standard built-in Date.prototype.toString method with Result(1) as its this object.
Return the string value that is the result of concatenating Result(3), a space character, and Result(5).