Node.js Date.addDays() API Last Updated : 12 Mar, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report The date-and-time.Date.addDays() is a minimalist collection of functions for manipulating JS date and time module which is used to add the extra Days to the existing date and time. Required Module: Install the module by npm or used it locally. By using npm.npm install date-and-time --saveBy using CDN link.<script src="/https/www.geeksforgeeks.org/path/to/date-and-time.min.js"></script>Syntax: addDays(dateObj, days)Parameters: This method takes the following arguments as parameters: dateobject: It is the string object of the date.days: It is the number of days.Return Value: This method returns updated date and time. Example 1: index.js // Node.js program to demonstrate the // Date.addDays() method // Importing module const date = require('date-and-time') // Creating object of current date and time // by using Date() const now = new Date(); // Adding Days to the existing date and time // by using date.addDays() method const value = date.addDays(now, 24); // Display the result console.log("updated date and time : " + value) Run the index.js file using the following command: node index.jsOutput: updated date and time : Wed Mar 31 2021 20:07:07 GMT+0530 (India Standard Time)Example 2: index.js // Node.js program to demonstrate the // Date.addDays() method // Importing module const date = require('date-and-time') // Creating object of current date and time // by using Date() const now = new Date(); now.setDate(20) // Adding Days to the existing date and time // by using date.addDays() method const value = date.addDays(now, 24); // Display the result console.log("updated date and time : " + value) Run the index.js file using the following command: node index.jsOutput: updated date and time : Tue Apr 13 2021 20:09:57 GMT+0530 (India Standard Time)Reference: https://github.com/knowledgecode/date-and-time#adddaysdateobj-days Comment More infoAdvertise with us Next Article Node.js Date.addDays() API R rohitprasad3 Follow Improve Article Tags : Web Technologies Node.js NodeJS-API NodeJS date-time Similar Reads Node.js Date.addYears() API The date-and-time.Date.addYears() is a minimalist collection of functions for manipulating JS date and time module which is used to add the extra years to the existing date and time. Required Module: Install the module by npm or used it locally. By using npm. npm install date-and-time --save By usin 2 min read Node.js Date.addHours() API The date-and-time.Date.addHours() is a minimalist collection of functions for manipulating JS date and time module which is used to add the extra Hours to the existing date and time. Required Module: Install the module by npm or used it locally. By using npm.npm install date-and-time --saveBy using 2 min read Node.js Date.addMonths() API The date-and-time.Date.addMonths() is a minimalist collection of functions for manipulating JS date and time module which is used to add the extra Month to the existing date and time. Required Module: Install the module by npm or used it locally. By using npm.npm install date-and-time --saveBy using 2 min read Node.js Date.compile() API The date-and-time.Date.compile() is a minimalist collection of functions for manipulating JS date and time module which is used to compile a format string for the parser. Required Module: Install the module by npm or used it locally. By using npm.npm install date-and-time --saveBy using CDN link. 2 min read Node.js Date.parse() API The date-and-time.Date.parse() is a minimalist collection of functions for manipulating JS date and time module which is used to parse the date according to a certain pattern. Required Module: Install the module by npm or used it locally. By using npm.npm install date-and-time --saveBy using CDN lin 2 min read Like