Truncate DateTime - CSharp System

CSharp examples for System:DateTime Calculate

Description

Truncate DateTime

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//  w w  w .jav  a2 s.  c o m

public class Main{
        public static DateTime Truncate(this DateTime dt)
        {
            return new DateTime(dt.Year, dt.Month, dt.Day);
        }
}

Related Tutorials