Discard Time - CSharp System

CSharp examples for System:DateTime Time

Description

Discard Time

Demo Code

// (c) Copyright Microsoft Corporation.
using System.Windows.Markup;
using System.Windows;
using System.Globalization;
using System.Diagnostics;
using System;/*from   w w  w .ja v a  2s.co  m*/

public class Main{
        public static DateTime? DiscardTime(DateTime? d)
        {
            if (d == null)
            {
                return null;
            }

            return d.Value.Date;
        }
}

Related Tutorials