Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Will anyone be kind enough to explain this code to me?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #40887
    antonio_89
    Participant

    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)
  • The forum ‘JavaScript’ is closed to new topics and replies.