d0 = new Date('December 07, 2017 00:00:00');
d1 = new Date();
dt = (d1.getTime() - d0.getTime()) / (1000*60*60*24);
document.getElementById("timework").innerHTML = + Math.round(dt)+ " дней" ;
(function(){
d0 = new Date('December 07, 2017 00:00:00');
d1 = new Date();
var t = d1.getTime() - d0.getTime();
dt = parseInt(t / (1000*60*60*24));
t = t%(1000*60*60*24);
dh = parseInt(t/ (1000*60*60));
t = t%(1000*60*60);
dm = parseInt(t/ (1000*60));
t = t%(1000*60);
ds = parseInt(t/ 1000);
t = t%(1000*60);
dms = parseInt(t%1000);
document.getElementById("timework").innerHTML = dt+ " дней "+dh+ " часов " + dm+" минут "+ ds + " секунд " + dms + " мс";
setTimeout(arguments.callee,20);
})();