We help IT Professionals succeed at work.
Get Started

TimeSpan Math

Last Modified: 2013-11-12
Is there a way to accurately return the diff between TimeSpans?

For example; inTrackLength = 00:54:16.1220000 and inTimeElapsed = 00:51:30.3910000

Dim TimeRemaining As TimeSpan = inTrackLength.Subtract(inTimeElapsed)

Since I am only displaying Hours:Minutes:Seconds

TimeRemaining is 00:02:45.7310000

I would expect TimeRemaining to be rounded to 00:02:46.

I guess my real question is how do I round-up TimeRemaining to the nearest second?
Watch Question
Sr. System Analyst
This problem has been solved!
Unlock 3 Answers and 4 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE