Export (0) Print
Expand All
Expand Minimize

2.1.45 [ECMA-262/5] Section 15.9.5.7, Date.prototype.toLocaleTimeString ()

C0006:

The specification states:

This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the "time" portion of 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, and IE11 Mode (All Versions)

The returned String value is determined from the following steps:

  1. Using the system locale settings, get the local time value that corresponds to the date value. Apply any appropriate civil time adjustments.

  2. If the year of Result(1) is less than or equal to 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.

  3. Use the GetTimeFormat Microsoft 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.

  4. If the call in step 3 fails, return the result of calling the standard built-in Date.prototype.toString method with Result(1) as its this object.

  5. Return the string value that is Result(3).

Show:
© 2014 Microsoft