CSharp examples for System:DateTime Hour
Returns a date in the future by hours.
// The contents of this file are subject to the New BSD using System;//w w w . java 2 s . co m public class Main{ /// <summary> /// Returns a date in the future by hours. /// </summary> /// <param name="hours">The hours.</param> /// <returns></returns> public static DateTime HoursFromNow(this int hours) { TimeSpan t = new TimeSpan(hours, 0, 0); return DateTime.Now.Add(t); } }