I have this short block of code that is checking a DateTime variable.
It looks like this:
DateTime launchDay = DateTime.Today;
// launchTime.Begin is a DateTime? type
if (launchTime.Begin == null || launchTime.Begin > launchDay) return NoContent();
The problem is, launchDay is 'today', which is apparently midnight?
So if my launchTime.Begin is, let's say 2pm....then that is greater(after) 'launchDay' because 'launchDay' is set at 12AM.
How can I compare the dates so that I know that they are on the same day and not worry about the time so much?
I only want it to return NoConent() if launchTime.Begin is null or launchTime.Begin is not on the same day as the launchDay.
Is there a way to do this without running into the issue I am coming up against?
Thanks!