2.1.119 [ECMA-262-1999] Section, Date.prototype.setDate (date)


(The bulleted step is added before step 1)

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

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

  2. Call ToNumber(date).

  3. Compute MakeDay(YearFromTime(t), MonthFromTime(t), Result(2)).

  4. Compute UTC(MakeDate(Result(3), TimeWithinDay(t))).

  5. Set the [[Value]] property of the this value to TimeClip(Result(4)).

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