1

My server sends current server time, and I need to handle them with 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!

Why currentDay.getDay() returns wrong number?

WhilseySoon
  • 322
  • 4
  • 14

0 Answers0