CSharp examples for System:DateTime Day
To Day Start
using System;//w w w . j av a2 s. c o m public class Main{ public static DateTime ToDayStart(this DateTime value) { string shortDate = value.ToShortDateString(); return Convert.ToDateTime(shortDate); } public static DateTime ToDayStart(this string value) { DateTime date = Convert.ToDateTime(value); string shortDate = date.ToShortDateString(); return Convert.ToDateTime(shortDate); } }