Add Hours and Minutes the easy way !

  • Thread starter Thread starter The Fantom
  • Start date Start date
T

The Fantom

How do I add to Hours and Minutes in VB.NET i.e

"12:35" + "12:30" = 25:05
 
Hi Fantom,

I would probably use this
Dim a As New TimeSpan(0, 12, 35, 0)
Dim b As New TimeSpan(0, 12, 30, 0)
Dim c As New TimeSpan
c = a.Add(b)
MessageBox.Show(c.ToString & " or " & _
CInt(c.TotalHours).ToString _
& ":" & c.Minutes.ToString("00"))

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top