I want to find if there are any difference between DateTime.UtcNow.
LastEdited(9/11/2011 21:00:00) is less than 30 minutes, so the bool value should return a false since the difference is higher.
But it returned true. May I know what is wrong here?
bool difference = ((DateTime.UtcNow - LastEdited).Minutes < 30);
Did you try using
The result is actually a
Timespanand if you check forTotalMinutesit gives you the entire span part in minutes whileMinuteswould give only the actual minute component of the Time interval.