CSharp examples for System:DateTime Minute
Returns a date in the past by minutes
// The contents of this file are subject to the New BSD using System;//from ww w . ja v a 2 s . com public class Main{ /// <summary> /// Returns a date in the past by minutes /// </summary> /// <param name="minutes">The minutes.</param> /// <returns></returns> public static DateTime MinutesAgo(this int minutes) { TimeSpan t = new TimeSpan(0, minutes, 0); return DateTime.Now.Subtract(t); } }