Trim Hours - CSharp System

CSharp examples for System:DateTime Hour

Description

Trim Hours

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*  w w  w  .j  ava2s  .  co m*/

public class Main{
        public static DateTime TrimHours(this DateTime d)
        {
            return new DateTime(d.Year, d.Month, d.Day, 0, 0, 0, 0);
        }
}

Related Tutorials