endDate = new Date('2015.10.31') - new Date() sec = parseInt(endDate/1000%60)//секунды console.log(sec)
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>ГГ</title> </head> <body> <script> endDate = new Date('2015.10.31') - new Date(); console.log(endDate); console.log(1000%60); sec = parseInt((endDate/1000)%60);//секунды console.log(sec); </script> </body> </html>