Date Time JavaScript DHTML



    the date


     


    
    
    var today = new Date();
    var then = new Date();
    then.setFullYear(3000,1,1);
    
    var diff = then.getTime() - today.getTime();
    
    diff = Math.floor(diff / (1000 * 60 * 60 * 24));
    
    var dateLoc = document.getElementById("dateField");
    
    dateLoc.innerHTML = diff + " days";