Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting time to 23:59:59 [duplicate]

Tags:

c#

datetime

time

Possible Duplicate:
How can I specify the latest time of day with DateTime

I need to compare a date range and am missing rows who's date is the upper comparison date but the time is higher than midnight. Is there a way to set the upper comparison's time to 23:59:59?

like image 941
Mike Wills Avatar asked Mar 12 '10 17:03

Mike Wills


1 Answers

This is a possible solution:

yourDateTime.Date.AddHours(23).AddMinutes(59).AddSeconds(59); 
like image 189
Webleeuw Avatar answered Sep 21 '22 10:09

Webleeuw