Timespan question

Posted on 2011-10-24
Last Modified: 2012-08-13
If i have a timespan variable name dtspan and I convert the variable to total minuets with dtspan.totalminutes and write that total minutes value to a Database table.

When I retrieve the total minutes from the DB later can I place it into a timespan variable to be able to the convert the total minutes into a day, hour, minute format. Keep in mind that the minutes are stored as integers in the DB table.


Question by:tybarton
    LVL 4

    Accepted Solution

    Hi Tybarton,

    Yes you can in order to do it just use the constructor that takes hours, minites and seconds.

    var timespan = new System.TimeSpan(0, numberOfMinites, 0)



    Author Comment

    Excellent. Thank you!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now