End Of Day - CSharp System

CSharp examples for System:DateTime Day

Description

End Of Day

Demo Code


using System.Collections.Generic;
using System;/*from  w w  w .j av  a 2  s  .co  m*/

public class Main{
        public static DateTime EndOfDay(this DateTime? date)
      {
         return !date.HasValue ? DateTime.MinValue : date.Value.EndOfDay();
      }
        public static DateTime EndOfDay(this DateTime date)
      {
         return date.Date.AddDays(1).Date.AddSeconds(-1);
      }
}

Related Tutorials