CSharp examples for System:DateTime Format
Returns a datetime for the DateTime passed to it which will be set to tomorrow's date and with zeroed time information
using System.Globalization; using System.Windows.Forms; using System.Text; using System.Linq; using System.Collections.Generic; using System;/* w w w . ja va2 s.com*/ public class Main{ // ------------------------------------------------------------------------------------ // ThisHour // Returns a datetime for the DateTime passed to it which will be set to tomorrow's date // and with zeroed time information. // ------------------------------------------------------------------------------------ public static DateTime ThisHourTomorrow(DateTime oDateTime) { DateTime oNewDateTime = new DateTime( oDateTime.Year, oDateTime.Month, oDateTime.Day, oDateTime.Hour, 0, 0 ); oNewDateTime = oNewDateTime.AddDays(1); return oNewDateTime; } }