Monday, July 25, 2011

Add 1 month to the date time - C#

DateTime nextmonth =DateTime.Today()+ new System.TimeSpan (30, 0, 0, 0 );

Today is  2011/04/01
It Return  2011/05/01

2 comments:

  1. As for me it is easier to do it using following approach - DateTima nextmonth = DateTime.Today().AddMonth(1);

    ReplyDelete