Setting a DateTime to the first of the next month?
c#
Solution
Try this:
olddate = olddate.AddMonths(1);
DateTime newDate = new DateTime(olddate.Year, olddate.Month, 1,
0, 0, 0, olddate.Kind);
Problem
If I have `var olddate = DateTime.Parse('05/13/2012');` and I want to get `var newdate = (the first of the month after olddate, 06/01/2012 in this case);` What would I code? I tried to set the month+1 but month has no setter.