Grow your CSS skills. Land your dream job.

Will anyone be kind enough to explain this code to me?

  • # November 20, 2012 at 4:16 am

    Hello,

    I have a Javascript script here which i cant really make much sense off. Would anyone be kind enough to explain to me?

    Your help is greatly appreciated!

    function daysTilDate(expiredate){

    expiredate = expiredate.substr(6,4)+”, “+expiredate.substr(3,2)+”, “+(expiredate.substr(0,2));

    var thisDay=new Date(expiredate);

    var CurrentDate = new Date();

    var thisYear=CurrentDate.getFullYear();

    thisDay.getFullYear(thisYear);

    var DayCount=(thisDay-CurrentDate)/(1000*60*60*24);

    DayCount=Math.round(DayCount);

    return DayCount;
    }

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".