CSharp examples for System:DateTime Month
Method for getting previous month
using System.Threading; using System.Globalization; using System.Collections.Generic; using System;// w w w .j a va2 s . c o m public class Main{ /// <summary> /// Method for getting previous month /// </summary> /// <param name="date">Date</param> /// <returns>Previous mouth</returns> public static DateTime GetPreviousMonth(this DateTime date) { return date.AddMonths(-1); } }