Skip to content

How to format JavaScript date to mm/dd/yyyy?

Im getting the date like ‘Wed Nov 08 2017 00:00:00 GMT-0800 (Pacific Standard Time)’ and putting the value in an input.

Is there a way to parse the datetime into a date, add five days to it, and then format it like mm/dd/yyyy?

I made a

  startingDate = new Date(5/5/2017);
 var adjustedDate = addDays(startingDate,13);



var date = new Date('Mon Aug 14 2017 00:00:00 GMT-0500 (CDT)');
var newdate= (date.getMonth() + 1) + '/' + date.getDate() + '/' +  date.getFullYear();
User contributions licensed under: CC BY-SA
8 People found this is helpful