V
V
Viktor Guzinov2019-09-16 23:29:24
JavaScript
Viktor Guzinov, 2019-09-16 23:29:24

How to make the month change when displaying tomorrow's date (now September 33)?

How, when adding several days, set the transition to the next month, since it currently displays September 33?
https://jsfiddle.net/u1jsx7bo/3/

Data = new Date();
Month = Data.getMonth();
Day = Data.getDate() + 17;
switch (Month)
{
  case 0: fMonth="января"; break;
.......
  case 11: fMonth="декабря"; break;
}
document.write("Завтра "+Day+" "+fMonth+" года");

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Glebov, 2019-09-16
@broof

https://jsfiddle.net/1952gjk7/

M
Mikhail Osher, 2019-09-16
@miraage

First Google issue: https://stackoverflow.com/questions/563406/add-day...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question