ASP.NET C# Convert seconds into time

Posted on 2007-08-02
Last Modified: 2008-03-04
Hi Guys,

Does anyone know how to convert a double into time format (eg 00:02:45) in C#.


Question by:Nigel_Taylor
    LVL 7

    Expert Comment

    LVL 7

    Expert Comment

    if u want to convert a double in to datetime please follow the below link
    LVL 53

    Accepted Solution

    TimeSpan y;
     y = TimeSpan.FromSeconds(63);
     myString = y.ToString();

    Replace 63 by your number of seconds

    Author Comment

    Thanks for the great response.


    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now