Timespan question

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.

Thanks,

Ty
tybartonAsked:
Who is Participating?
 
Gruff82Commented:
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)

Thanks

Gruff
0
 
tybartonAuthor Commented:
Excellent. Thank you!

Ty
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.