Here are five cases. The results of the last three cases are surprising to me.
// Firefox 40.0.3
// Eastern time zone (ET)
var d;
d = new Date("January 1, 2015");
alert('Month: ' + d.getMonth() + ' Date: ' + d.getDate() + ' UTC: ' + d.toUTCString());
// Month: 0 Date: 1 UTC: Thu, 01 Jan 2015 05:00:00 GMT
d = new Date("January 2, 2015");
alert('Month: ' + d.getMonth() + ' Date: ' + d.getDate() + ' UTC: ' + d.toUTCString());
// Month: 0 Date: 2 UTC: Fri, 02 Jan 2015 05:00:00 GMT
d = new Date("January 1, 2015 00:00:00 GMT");
alert('Month: ' + d.getMonth() + ' Date: ' + d.getDate() + ' UTC: ' + d.toUTCString());
// Month: 11 Date: 31 UTC: Thu, 01 Jan 2015 00:00:00 GMT
d = new Date("2015-01-01");
alert('Month: ' + d.getMonth() + ' Date: ' + d.getDate() + ' UTC: ' + d.toUTCString());
// Month: 11 Date: 31 UTC: Thu, 01 Jan 2015 00:00:00 GMT
d = new Date("2015-01-02");
alert('Month: ' + d.getMonth() + ' Date: ' + d.getDate() + ' UTC: ' + d.toUTCString());
// Month: 0 Date: 1 UTC: Fri, 02 Jan 2015 00:00:00 GMT
It must be some discrepancy between UTC and local time. I see part of the answer. The function getDate() returns the specified date according to local time.
It seems that for getDate(), 00:00:00 GMT is the previous day in local time, so I'm getting the previous date instead of what I expected.
Maybe what I should really be asking is why does the Date constructor sometimes interpret the argument as local time, and sometimes as UTC time? What are rules on that?