Get start of day in C#

By [)ia6l0 iii

Extension method to get the start of a day

  public static DateTime GetStartOfDay(this DateTime date)
        {
            return date.Date;
        }

The above method returns the start of the day, given a date.

Related FAQs

Extension method to get the end of a day
Extension method to get the elasped time
Get start of day in C#  (4430 Views)