Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I need a way to calculate duration between two times & frames.

00:00:00:00 (hours, minutes, seconds, frames)

Frames are between 0-24.

I have setup four start fields and four end fields

how do I get the total duration?

[This message has been edited by MacNut (edited February 09, 2001).]

I can't see an easy way of doing this! It seems to me that you need to find the difference of each part separately either by using Left [text,number}; Right[text,number and Middle[text,start,number] or by entering each part in four separate fields and then doing the calculation that way. This way would seem to me to be the best since you can use number fields.

John is correct. You might be able to use normal time calculations to subtract the times, then fix it up for frames. For instance, if the times are the same, just subtract the frame numbers. It's just reinventing a form of subtraction, except when frame 1 is greater than frame 2, you have to borrow seconds. For instance:

01:01:55:55 Time 1

01:01:59:34 Time 2

Time 2 - Time 1

Separate each number into T1 and F1, T2 and F2. T1 and T2 are time fields

DeltaT =

Case(

T2 >= T1 and F2 >= F1, T2 - T1,

T2 > T1 and F2 < F1, T2 - T1 - 1,

etc.

DeltaF =

T2 >= T1 and F2 >= F1, F2 - F1,

T2 > T1 and F2 < F1, (F2 + 24) - F1,

etc.

I'm not going to take the time to work it all out for you, but this is the general idea. Based upon the values of times and frames, you can take care of all cases with both positive and negative time/frame results. After DeltaT and DeltaF are calculated you can put them back together for display with:

TimeToText(DeltaT) & ":" & Right("00" & NumberToText(DeltaF),2)

We used to do rallye times on a pocket calculator using a trick of adding a zero between hours and and minutes 12:55 --> 12055. In this way you can add and subtract hours and minutes. All you have to do when something other than zero shows up in the middle digit is to add or subtract 940, as appropriate. I'm sure a similar system could also be created as an alternative.

-bd

(If you need to have this method worked out for you, FM is NOT just a FMFORUMS hobby for me!, contact me by email)

I suggest converting everything to frames like so:

TotalFrames1 = ((((Hours1 * 60)+ Minutes1)*60 + Seconds1)*24)+ Frames1

TotalFrames2 = ((((Hours2 * 60)+ Minutes2)*60 + Seconds2)*24)+ Frames2

FramesDifference = TotalFrames1 - TotalFrames2

Then convert back to Hour/Minutes/Seconds/Frames:

Hours = Int(FramesDifference/(60*60*24))

Minutes = Mod(Int(FramesDifference/(60*24)),60)

Seconds = Mod(Int(FramesDifference/24),60)

Frames = Mod(FramesDifference,24)

I didn't check the math here too carefully, but the basic idea should work.

Good idea, Bob! The arithmetic is probably faster than the logical tests required otherwise. -bd

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.