Difference between two dates

QUESTION:  What is the easiest way to find the difference between two dates?

 

DateTime userLoginTime = (DateTime)roteTimeout.LastLoginTime;

TimeSpan span = DateTime.Now.Subtract(userLoginTime);

if (span.Seconds > userTimeout.TimeoutPeriod) 

{

blog comments powered by Disqus

About the author

You have probably figured out by now that my name is Bryan Avery (if not, please refer to your browser's address field).  Technology is more than a career to me - it is both a hobby and a passion.  I'm an ASP.NET/C# Developer at heart...

Month List