Export (0) Print
Expand All
Expand Minimize

2.1.39 [ECMA-262/5] Section 15.9.4.3, Date.UTC (year, month [, date [, hours [, minutes [, seconds [, ms ]]]]])

V0039:

The specification states:

When the UTC function is called with fewer than two arguments, the behaviour is implementation-dependent.

IE9 Mode, IE10 Mode, and IE11 Mode (All Versions)

When the UTC function is called with less than two arguments, the following steps are taken:

  1. If year is supplied, let y be ToNumber(year); otherwise, let y be 0.

  2. If month is supplied, let m be ToNumber(month); otherwise, let m be 0.

  3. If date is supplied, let dt be ToNumber(date); otherwise, let dt be 1.

  4. If hours is supplied, let h be ToNumber(hours); otherwise, let h be 0.

  5. If minutes is supplied, let min be ToNumber(minutes); otherwise, let min be 0.

  6. If seconds is supplied, let s be ToNumber(seconds); otherwise, let s be 0.

  7. If ms is supplied, let milli be ToNumber(ms); otherwise, let milli be 0.

  8. If y is not NaN and 0 ≤ ToInteger(y) ≤ 99, let yr be 1900+ToInteger(y); otherwise, let yr be y.

  9. Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))).

Show:
© 2014 Microsoft