Wednesday, January 5, 2011

Date time how to get last month or previous month.

This is good example of datetime how to get last month.




DateTime LastMonthDate=DateTime.Now.AddMonths(-1);
Response.Write(LastMonthDate.ToString("MM/dd/yyyy"));

DateTime.Now.AddMonths(-1).ToString("MM/dd/yyyy")

No comments: