0
我有以下的測試代碼:類Date setMonth設置怪異值
var d1 : Date = new Date("2016/02/20 15:00:00 UTC-0000");
trace(d1.toUTCString());
d1.monthUTC++;
trace(d1.toUTCString());
var d2 : Date = new Date("2016/03/31 15:00:00 UTC-0000");
trace(d2.toUTCString());
d2.monthUTC++;
trace(d2.toUTCString());
跟蹤顯示
[trace] Sat Feb 20 15:00:00 2016 UTC
[trace] Sun Mar 20 15:00:00 2016 UTC
[trace] Thu Mar 31 15:00:00 2016 UTC
[trace] Sun May 1 15:00:00 2016 UTC
爲什麼迄今在第二個例子中跳1個月1天,而不是僅僅一個月? (從3月31日到5月1日)?