CSharp examples for System:DateTime Day
To Day End
using System;//w w w . j a v a 2 s .com public class Main{ public static DateTime ToDayEnd(this DateTime value) { DateTime shortDate = Convert.ToDateTime(value.ToShortDateString()); return shortDate.AddDays(1).AddSeconds(-1); } public static DateTime ToDayEnd(this string value) { DateTime date = Convert.ToDateTime(value); DateTime shortDate = Convert.ToDateTime(date.ToShortDateString()); return shortDate.AddDays(1).AddSeconds(-1); } }