?
Solved

getting seconds passed since ....

Posted on 2006-04-27
3
Medium Priority
?
267 Views
Last Modified: 2010-04-16
Goodday,

How do I get the number of seconds passed since a certain date (say since 01-01-2006)?
Thanks!
Marco
0
Comment
Question by:EnolaKotrotsos
3 Comments
 
LVL 11

Accepted Solution

by:
Agarici earned 2000 total points
ID: 16551685
i think you should do something like:

DateTime dateStart, dateEnd;

TimeSpan ts = dateEnd - dateStart;
Console.Write( "{0}", ts.Secconds );
0
 
LVL 4

Expert Comment

by:SmithJW
ID: 16551757
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 );
0
 
LVL 1

Author Comment

by:EnolaKotrotsos
ID: 16551768
Hey thanks people!.

Marco
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month15 days, 19 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question