MakeDay() (Time calculation)

A date and time algorithm.

Availability:

ECMAScript edition - 2
Property/method value type:Number primitive

The MakeDay() operator calculates a number of days from its three arguments. Each argument must be an ECMAScript number value.

All of the arguments must be numeric and finite values. The values should be integers. If they are not then the result will be NaN.

The month number is used as a lookup to establish the number of days in the preceding months. This will also take the year number into account because a leap year calculation may be necessary.

The standard does not mandate any range checking, however it would be sensible to include range checks in the implementation of this functionality.

Although this is called an operator in the standard, its behavior is more like that of a function. It is not part of the formal language implementation but is a useful function to have available and can be simulated by writing a script based function. It is documented in the standard to assist in the algorithmic breakdown of the Date method handlers.

the result is a day value in milliseconds since the base date.

See also:Cast operator, Date object, Date(), Date.UTC(), Time range, Time value

Cross-references:

ECMA 262 edition 2 - section - 15.9.1.12

ECMA 262 edition 3 - section - 15.9.1.12