Date At Midnight - CSharp System

CSharp examples for System:DateTime Calculate

Description

Date At Midnight

Demo Code


using System.Text;
using System.Linq;
using System.Globalization;
using System.Collections.Generic;
using System;/* ww w  .j  ava2  s  .co  m*/

public class Main{
        public static DateTime DateAtMidnight(DateTime dt)
		{
			if (null == dt)
				dt = new DateTime();

			return new DateTime(dt.Year, dt.Month, dt.Day);
		}
}

Related Tutorials