CSharp examples for System:DateTime Minute
Will give you the DateTime object given the number of minutes you go back.
using System;//w w w. jav a 2 s . com public class Main{ /// <summary> /// Will give you the DateTime object given the number of minutes you go back. /// </summary> /// <param name="minutes"> /// The days. /// </param> /// <returns> /// DateTime object /// </returns> public static DateTime MinutesAgo(this int minutes) { var t = new TimeSpan(0, minutes, 0); return DateTime.Now.Subtract(t); } }