Get next date from given date in javascript

next date

We need to add one day for the given date.  The given date is '24-03-2017'.  By using the below javascript code get next date.

var date = '24-03-2017';
var nextday = new Date(date.setTime( date.getTime() + 1 * 86400000 ));
var day = nextday.getDate();
var months = (nextday.getMonth() + 1);
// Months use 0 index.		
var nextdate= nextday.getFullYear()+'-'+(months[1] ? month :  '0'+ months[0]) + '-' +  (day[1] ? day :  '0'+ day[0]);	


The result is : 


You might also like:

File Upload Using Angular Js and Node Js

28-05-2018 AngularJs Node js file upload multer module

Time Sorting Ascending or Descending Order in Javascript

19-07-2017 Javascript ascending order descending order

How to get id by using name attribute in javascript

20-03-2017 html id name javascript

Call a function every second or 5 seconds in javascript

22-02-2017 setinterval function calling

Get Unique values from array/object in javascript

19-02-2017 javascript unique remove repeated values from array