How to check if a DateTime occurs today?

Viewed 88179

Is there a better .net way to check if a DateTime has occured 'today' then the code below?

if ( newsStory.WhenAdded.Day == DateTime.Now.Day &&
     newsStory.WhenAdded.Month == DateTime.Now.Month &&
     newsStory.WhenAdded.Year == DateTime.Now.Year )
{ 
    // Story happened today
}
else
{ 
    // Story didn't happen today
}
12 Answers
Related