How to add to a date one day?

Tell me what works and 1 day adds

var timeend2 = new Date(2018,01,31);
alert(timeend2);
timeend2.setDate(timeend2.getDate() +1);

but alert shows
Sat, 03 Mar 2018 00:00:00 GMT+0200

var timeend2 = new Date();
timeend2.setDate(timeend2.getDate() +1);

if so, then 1 day not adds
June 8th 19 at 17:19
2 answers
June 8th 19 at 17:21
var secoffs = 24 * 60 * 60 * 1000;
var vof = timeend2.valueOf();
var i = 1; // one day
in the mining var = new Date(vof + (secoffs * i));
June 8th 19 at 17:23
moment.js

Find more questions by tags JavaScript