|
|
|
|
|
by ygra
2559 days ago
|
|
> (date 2019-07-31).AddMonths(2)
Montag, 30. September 2019 00:00:00
.NET agrees, though :)For software libraries it's a bit of a pickle, though, as you have the trade-off between »do what an end user would expect« and »do exactly as told, and let the programmer deal with the weirdness«. Admittedly, adding months is something that I'd rarely do as a programmer when the context isn't what a user would expect. Adding 30 days can be done in much the same way if that's really what's intended. Interesting question, though: Is 2 months from 2019-07-28 2019-09-28 because the day part is the same, or 2019-09-27 because it's three days from the end of the month? ;-) |
|