devlev1980
2/27/2018 - 4:26 PM

Compare how ticks in date and in 24 hours

let date1 = new Date("2017-03-05 10:00:01").getTime();       //ticks in fist date
    let date2 = new Date("2017-03-06 10:00:02").getTime();   //ticks in second date
    let time = date2 - date1;  //msec                        // difference between to dates in ticks
    let fulldeymillisecond = 24*60*60*1000;                  //ticks in 24 hour
     if(time > fulldeymillisecond)                           //Compare how ticks in difference and ticks in 24 hours
     {
       console.log('Blaaaa!!!');
       console.log(date1);
       console.log(date2);
       console.log(time);
       console.log(fulldeymillisecond);
     }