'how can add month without change number of days
I want to create multiple dates .I get a specific date from the user and I want to add a month based on that date, but I do not want to change the number of days, for example. User enter 2020-10-10 The next dates are the 10th of each month
Solution 1:[1]
You can just use DateTime.AddMonths(x) where x means the number of months you want to add (or to substract if x < 0). You can as example create a for loop for x = 1 to 10 and then print these 10 dates. Of course, it's never ruled out when adding exact one month that the day will change.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
