CSharp examples for System:DateTime Time
Returns 12:59:59pm time for the date passed. Useful for date only search ranges end value
using System;/*from w w w. jav a 2 s .c o m*/ public class Main{ /// <summary> /// Returns 12:59:59pm time for the date passed. /// Useful for date only search ranges end value /// </summary> /// <param name="date">Date to convert</param> /// <returns></returns> public static DateTime EndOfDay(this DateTime date) { return date.Date.AddDays(1).AddMilliseconds(-1); } }