I\'m using the following query to get the next month.
int theMonth = ((System.DateTime)periodStartDate).Month+1;
But if the periodstartDate
I like V4V's answer, but I write it this way:
DateTime dt = new DateTime(2011,12,2);
DateTime firstDayNextMonth = dt.AddMonths(1).AddDays(-dt.Day+1);
For example, I might be computing a future time and this code does that without stripping out the time part.
Per hvd's most astute comment, this code should be:
DateTime dt = new DateTime(2011,12,2);
DateTime firstDayNextMonth = dt.AddDays(-dt.Day+1).AddMonths(1);