2.1.117 [ECMA-262-1999] Section 15.9.5.35, Date.prototype.setHours (hour [, min [, sec [, ms ] ] ] )

V0177:

If min is not specified, this function behaves as if min were specified with the value getMinutes( ).

If sec is not specified, this function behaves as if sec were specified with the value getSeconds( ).

If ms is not specified, this function behaves as if ms were specified with the value getMilliseconds( ).

(The bulleted step is added before step 1)

  • __If the argument hour is not present, throw a TypeError exception.__

  1. Let t be the result of LocalTime(this time value).

  2. Call ToNumber(hour).

  3. If min is not specified, compute MinFromTime(t); otherwise, call ToNumber(min).

  4. If sec is not specified, compute SecFromTime(t); otherwise, call ToNumber(sec).

  5. If ms is not specified, compute msFromTime(t); otherwise, call ToNumber(ms).

  6. Compute MakeTime(Result(2), Result(3), Result(4), Result(5)).

  7. Compute UTC(MakeDate(Day(t), Result(6))).

  8. Set the [[Value]] property of the this value to TimeClip(Result(7)).

  9. Return the value of the [[Value]] property of the this value.

The length property of the setHours method is 4.