Link to home
Start Free TrialLog in
Avatar of EnolaKotrotsos
EnolaKotrotsos

asked on

getting seconds passed since ....

Goodday,

How do I get the number of seconds passed since a certain date (say since 01-01-2006)?
Thanks!
Marco
ASKER CERTIFIED SOLUTION
Avatar of Agarici
Agarici
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SmithJW
SmithJW

almost correct, but you should use TotalSeconds
e.g.

DateTime SomeDate = Whatever date you need;

TimeSpan ts = DateTime.Now - SomeDate;
Console.Write( "{0}", ts.TotalSecconds );
Avatar of EnolaKotrotsos

ASKER

Hey thanks people!.

Marco