troubleshooting Question

subtract one time from another

Avatar of RupertA
RupertAFlag for United Kingdom of Great Britain and Northern Ireland asked on
9 Comments1 Solution4390 ViewsLast Modified:
Hi I am not a programmery type and was hoping somebody could help me out with a function. I have two variables, which are Bigger_Time and Smaller_Time. These variables are in the format 00:00:00. I have no idea what type of variable they are declared to because they have come from a program called lectora. So maybe it would be best in the function below to convert them to a managable form? I definitely know though that the contents of Bigger_Time and Smaller_Time is in the format 00:00:00.  So for instance 00:34:56 would mean 34 minutes and 56 seconds. I wish to be able to subtract Smaller_Time from Bigger_Time in the function below and put the result in a a variable that I have already declared called resultingtime.  For instance if Bigger_Time is 00:09:52 and Smaller_Time is 00:04:27 then the difference is 00:05:25.

I know that my function will look like this

<SCRIPT language="JavaScript">

function subtract_time()




I was hoping somebody could write in and show me what should go in the IN HERE part. I have had a go but have failed. Hope somebody else has the knowledge. Thanks. If you could give me the fucntion I would be grateful. If not I know I will spend hours trying to work out why it doesn't work, only for it to be something simple. Thanks.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros