CSharp examples for System:DateTime Calculate
Gets a DateTime representing midnight on the current date
using System;/*from w w w.j a v a 2s .c o m*/ public class Main{ /// <summary> /// Gets a DateTime representing midnight on the current date /// </summary> /// <param name="current">The current date</param> public static DateTime Midnight(this DateTime current) { var midnight = new DateTime(current.Year, current.Month, current.Day); return midnight; } }