calculate time

csharp New Zealand
  • 13 years ago
    haw to convert and display time in seconds?
  • 13 years ago
    Canm you tell us what are you trying to achieve? If you want to get the current time it is

    System.DateTime.Now







  • 13 years ago

    If you are talking about TimeSpan, you can do this:

    TimeSpan timeSinceMinValue = DateTime.Now - DateTime.MinValue;

    Console.WriteLine(timeSinceMinValue.TotalSeconds.ToString());

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray