I am trying to compare a DateTime
variable with another DateTime
variable and if they are with 24 hours of one another then do something. So for example,
if (todaysDate == OtherDate)
{
//do stuff only if otherDate is within 24 hours of todaysDate
}
I understand I can use the operators found here, https://msdn.microsoft.com/en-us/library/ff986512(v=vs.110).aspx to compare the dates, but none of those comparisons seem to give me what I'm wanting so was curious how this might be accomplished.