How to Date Add Days Using Node.js?

04-Oct-2022

.

Admin

How to Date Add Days Using Node.js?

Hello Friends,

In this tute, we will discuss how to date add days using nodejs. In this article, we will implement a date add days using node js. I explained simply step by step date add days using node.js. This post will give you a simple example of nodejs date add days. you will do the following things for node js date add days.

In this post, you'll learn how to date add days using nodejs. I will explain simply about date add days using node js. We will check how to date add days in nodejs.

So, let's start following example:

server.js


// add day in current date

var dayAdd = 2;

// add 2 day in current day

var addDays = new Date(Date.now() + dayAdd * 24*60*60*1000);

console.log(addDays);

Output:

2022-10-06

I hope it can help you...

#Node JS