DateTime is immutable. That means you cannot change it’s state and have to assign the result of an operation to a variable.
endDate = endDate.AddDays(addedDays);
More Related Contents:
- How do I get the correct time in C#
- Days between two dates in asp.net
- Change system date programmatically
- A type for Date only in C# – why is there no Date type?
- Convert DateTime to Julian Date in C# (ToOADate Safe?)
- Difference between System.DateTime.Now and System.DateTime.Today
- Count number of Mondays in a given date range
- Random date in C#
- Specify Date format in MVC5 (dd/MM/yyyy)
- How Function overloading saves memory [closed]
- Calculate difference between two dates (number of days)?
- C# DateTime.Now precision
- What does “DateTime?” mean in C#?
- C# object initialization of read only collection properties
- Reading From a Text File in C#
- What’s a good way to overwrite DateTime.Now during testing?
- DateTime and CultureInfo
- Check if datetime instance falls in between other two datetime objects
- C#: Dynamic runtime cast
- Adding unknown (at design time) properties to an ExpandoObject
- How to initialize a DateTime field?
- Getting the first and last day of a month, using a given DateTime object
- Why classes that implement variant interfaces remain invariant?
- Cannot convert from Hijri Date to Gregorian date (c#)
- DataGridView column footer c#.net winforms
- How to add and get Header values in WebApi
- How to check if a DateTime occurs today?
- DateTime.ParseExact() does not grok 24-hour time values?
- C#: DateTime.DayOfWeek to string comparison
- Adding different type of generic objects into generic list