This works in Chrome:
var dateArray = [2012, 6, 5]; var dateObject = new Date(dateArray);
And I get June 5, 2012. I also tried in the Android browser and get the same results. However, the same does not work in Firefox or Safari. I could say:
var dateObject = new Date(2012, 6, 5);
But it will be July 5, 2012, as it should be, as well as what I get with Chrome.
My question is: the first sample part of the ECMA standard? Is Chrome really bleeding so much and I expect other browsers to support it in the future? Or is it just some kind of v8-ism that I should avoid for portability?
I am trying to find links for this particular form of the Date constructor, but could not get.
javascript date
Edward samson
source share