15.9.3.2 new Date(value)

2010-07-19

date new Date(value:string|number|mixed)

Create a new Date object using the argument to create the time. If the argument is a string, it is converted to a number value using Date.parse. Otherwise the argument is coerced to an int.

The resulting object will have [[Prototype]] set to the original Date prototype object (15.9.4.1), [[Class]] is set to "Date", [[Extensible]] is set to true and [[PrimitiveValue]] is set to the ConstructDate2 function below.

Code: (Meta Ecma)
ConstructDate2(value){
var v = ToPrimitive(value);
if (Type(v) == 'String') var V = Date.parse(v);
else var V = ToNumber(v);
return TimeClip(V);
}