Biku7
Biku7

Reputation: 470

Why setDate() is giving the final date in milliseconds in nodejs?

I a trying to save a date to the nextMonth. For that I am first setting the month to next 30 days. But the final output date it is giving me in milliseconds. I want the date in GMT format strictly.

What can I do for that?

var snm = new Date();
snm = snm.setDate(snm.getDate() + 30);
                console.log("snm = "+ snm);

Upvotes: 1

Views: 246

Answers (1)

Prabhu
Prabhu

Reputation: 768

Try this

var snm = new Date();
snm.setDate(snm.getDate() + 30)
console.log("snm = "+ snm.toString());

Upvotes: -2

Related Questions