endDate = new Date('2015.10.31') - new Date() sec = parseInt(endDate/1000%60)//секунды console.log(sec)