从时间戳获取日期不起作用 - javascript

时间:2015-05-26 20:58:33

标签: javascript

3
10

虽然时间戳正确,但我得到的当前变量的日期无效。

  _.each(reduced[i].data, function(timerevenueObj) {

      var timestamp = timerevenueObj[0];

       for(var j = 0; j < days.length; j++)
       {


          var current = new Date(timestamp);
          var previous = days[i];

           console.log(current);
          if (current.toDateString() === previous.toDateString()) {
            console.log("*** Same day ***");
              rev = timerevenueObj[1];
          }
          innerdata.push(timerevenueObj[1])

    //console.log(timerevenueObj);

  });

0 个答案:

没有答案