Pull the day and month from the date if the date in a variable?

The challenge is to add 3 days to current date. The resulting day and month display on the page.

3 days I added.
var D = new Date();
D. setDate(D. getDate() + 3);

as of received to pull the day and month?
June 5th 19 at 21:07
1 answer
June 5th 19 at 21:09
Solution
day: getDate()
month: getMonth()

var date = new Date();
date.setDate(date.getDate() + 3);
var dayOfMonth = date.getDate();
var month = date.getMonth() + 1;

document.body.innerHTML = 'Day:' + dayOfMonth + ' Month: '+ month;
Demo
thank you - isabell26 commented on June 5th 19 at 21:12
do not forget that months are counted from 0 - geovanni_Hegmann commented on June 5th 19 at 21:15
exactly. Thank you! - Lenny.Botsfo commented on June 5th 19 at 21:18

Find more questions by tags JavaScript