This works in Chrome:
var dateArray = [2012, 6, 5];
var dateObject = new Date(dateArray);
And I get June 5, 2012. I also tried on an Androi
Based on Jure's answer. I have cleared up Sergio's question in the comments by showing that the null is, in fact, the scope of the call.
function newInstance(clazz, arguments, scope) {
return new (Function.prototype.bind.apply(clazz, [scope].concat(arguments)));
}
// Scope is not needed here.
var date = newInstance(Date, [2003, 0, 2, 4, 5, 6]);
// 1/2/2003, 4:05:06 AM (Locale = US EST)
document.body.innerHTML = date.toLocaleString();