DateTime.AddDays() not working as expected

It does work but you don’t do anything with the return value, try

aux2 = aux2.AddDays(1);

DateTimes share this facet of immutability with Strings.


EDIT

There is a little paragraph about it on MSDN

This method does not change the value of this DateTime. Instead, it
returns a new DateTime whose value is the result of this operation.

Leave a Comment