Answers for "add days months and years to date in js"

1

add days to date javascript

const date = new Date();
const days = 5;
date.setDate(date.getDate() + days);
Posted by: Guest on October-22-2021
0

add 1 year to given date in javascript

var d = new Date();
    var year = d.getFullYear();
    var month = d.getMonth();
    var day = d.getDate();
    var c = new Date(year);
    console.log(c);
 Run code snippetHide results
Posted by: Guest on December-24-2021

Code answers related to "add days months and years to date in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language