I suggest you ...

Number of days from a specific date to another date, example number of days to Dec 25th?, or what is the date 45 days from now?

78 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Anonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Ryan Ouyang commented  ·   ·  Flag as inappropriate

        //Date before/after now, negative(before) or positive(after),
        dateFromNow = function (days)
        {
        var date = new Date();
        date.setTime(date.getTime()+days*86400000);
        return date.toLocaleDateString();
        }
        //Days between two date.
        daysBetween = function (y1, m1, d1, y2, m2, d2)
        {
        var d1 = new Date(y1, m1, d1);
        var d2 = new Date(y2, m2, d2);
        return Math.abs(d1.getTime()-d2.getTime())/86400000;
        }

      Feedback and Knowledge Base