Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

JavaScript, get date of the next day [duplicate]

$
0
0

This question already has an answer here:

I have the following script which returns the next day:

function today(i)
    {
        var today = new Date();
        var dd = today.getDate()+1;
        var mm = today.getMonth()+1;
        var yyyy = today.getFullYear();

        today = dd+'/'+mm+'/'+yyyy;

        return today;   
    }

By using this:

today.getDate()+1;

I am getting the next day of the month (for example today would get 16).

My problem is that this could be on the last day of the month, and therefore end up returning 32/4/2014

Is there a way I can get the guaranteed correct date for the next day?


Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>