Truncate Time - CSharp System

CSharp examples for System:DateTime Time

Description

Truncate Time

Demo Code


using System.Collections.Generic;
using System;//from w w w  . ja va  2 s .  c o  m

public class Main{
        public static DateTime TruncateTime(this DateTime date)
        {
            return Convert.ToDateTime(date.ToShortDateString());
        }
        public static DateTime ToDateTime(this string date)
        {
            return Convert.ToDateTime(date);
        }
}

Related Tutorials