Date.getDay()返回错误的星期几

时间:2016-04-08 07:41:03

标签: javascript date

我的服务器发送当前服务器时间,我需要用JS处理它们。

var currentDate = new Date(someYear, someMonth, someDay, 12);
console.log(currentDate.getDate()+'.'
            +currentDate.getMonth()+'.'
            +currentDate.getFullYear()
        ); //8.4.2016 - this is right, today is 8th April of 2016
console.log(currentDate.getDay()); // 0. But today is Friday, not Monday!

为什么currentDay.getDay()返回错误的数字?

0 个答案:

没有答案