posted on January 10, 2014 06:40
public static DateTime GetFirstDayOfNextMonth(DateTime startDate)
{
if (startDate.Month == 12) // its end of year , we need to add another year to new date:
{
startDate = new DateTime((startDate.Year + 1), 1, 1);
}
else
{
startDate = new DateTime(startDate.Year, (startDate.Month + 1), 1);
}
return startDate;
}