Using c# System.DateTime like c++ time_t

Posted by David Boland on Stack Overflow See other posts from Stack Overflow or by David Boland
Published on 2011-03-13T16:02:56Z Indexed on 2011/03/13 16:10 UTC
Read the original article Hit count: 312

Filed under:
|
|

In C++ I am able to get the current time when my application starts I can use

time_t appStartTime = time(null);

then to find the difference in seconds from when it started I can just do the same thing, then find the difference. It looks like I should be using "System.DateTime" in C# net, but the MSDN is confusing in its explanation.

How can I use System.DateTime to find the difference in time (in seconds) between when my application starts, and the current time?

© Stack Overflow or respective owner

Related posts about c#

Related posts about datetime