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

  • Author

I'm trying to figure out how to calculate the correct elapsed time using the 24 hr format, start time is 23:00 and end time is 02:00. It should be 3:00 but is -21:00. The calculation is (end time - start time)I know there is a way to compensate but I can't figure it out.

Any help would be appreciated.

Thanks for you time,

Bob...

I'm trying to figure out how to calculate the correct elapsed time using the 24 hr format, start time is 23:00 and end time is 02:00. It should be 3:00 but is -21:00. The calculation is (end time - start time)I know there is a way to compensate but I can't figure it out.

Any help would be appreciated.

Thanks for you time,

Bob...

  • Author

I'm trying to figure out how to calculate the correct elapsed time using the 24 hr format, start time is 23:00 and end time is 02:00. It should be 3:00 but is -21:00. The calculation is (end time - start time)I know there is a way to compensate but I can't figure it out.

Any help would be appreciated.

Thanks for you time,

Bob...

Try:

EndTime - StartTime + Time ( 24 * ( EndTime < StartTime ) ; 0 ; 0 )

Try:

EndTime - StartTime + Time ( 24 * ( EndTime < StartTime ) ; 0 ; 0 )

Try:

EndTime - StartTime + Time ( 24 * ( EndTime < StartTime ) ; 0 ; 0 )

Just off the top of my head:

case(end time - start time < 0; (end time - start time) + 24; end time - start time)

There's probably a better way.

Just off the top of my head:

case(end time - start time < 0; (end time - start time) + 24; end time - start time)

There's probably a better way.

Just off the top of my head:

case(end time - start time < 0; (end time - start time) + 24; end time - start time)

There's probably a better way.

if ( Hour (Start Time) <= Hour (End Time), End Time- Start Time,

End Time - Time ( Hours(Start Time) + 24,

Minute(Start Time), Second(Start Time) ) )

I didn't test this, so it might require some work on your part. But, the idea is that you need to adjust the Calculation by 24 Hours.

You will have to check this, but you should be able to test for the negative result somehow. It would probably be some script steps like:

if( Hour(ResultTime) < 0)

Set Field( ResultTime,

Time( Hour(ResultTime)+24, Minute(ResultTime), Seconds(ResultTime) ) )

endif

I haven't tried it, so I am not sure if the -21:00 will give you a -21 in the Hours. If so, this will work. If not, experiment with the If Script Step to catch the negative result.

if ( Hour (Start Time) <= Hour (End Time), End Time- Start Time,

End Time - Time ( Hours(Start Time) + 24,

Minute(Start Time), Second(Start Time) ) )

I didn't test this, so it might require some work on your part. But, the idea is that you need to adjust the Calculation by 24 Hours.

You will have to check this, but you should be able to test for the negative result somehow. It would probably be some script steps like:

if( Hour(ResultTime) < 0)

Set Field( ResultTime,

Time( Hour(ResultTime)+24, Minute(ResultTime), Seconds(ResultTime) ) )

endif

I haven't tried it, so I am not sure if the -21:00 will give you a -21 in the Hours. If so, this will work. If not, experiment with the If Script Step to catch the negative result.

if ( Hour (Start Time) <= Hour (End Time), End Time- Start Time,

End Time - Time ( Hours(Start Time) + 24,

Minute(Start Time), Second(Start Time) ) )

I didn't test this, so it might require some work on your part. But, the idea is that you need to adjust the Calculation by 24 Hours.

You will have to check this, but you should be able to test for the negative result somehow. It would probably be some script steps like:

if( Hour(ResultTime) < 0)

Set Field( ResultTime,

Time( Hour(ResultTime)+24, Minute(ResultTime), Seconds(ResultTime) ) )

endif

I haven't tried it, so I am not sure if the -21:00 will give you a -21 in the Hours. If so, this will work. If not, experiment with the If Script Step to catch the negative result.

  • Author

Outstanding, that did it. Thanks so much for the information and quick response. Now on to the next opportunity. The actual calculation I used is:

If ( EndTime < StartTime; EndTime - StartTime + Time ( 24 * ( EndTime < StartTime) ; 0 ; 0 ); EndTime - StartTime)This will correct for the normal 24 hour times and detect the situation where we go over the 24 hour period into the next day and fix the time. Thanks to the other contributors as well.

Bob...

  • Author

Outstanding, that did it. Thanks so much for the information and quick response. Now on to the next opportunity. The actual calculation I used is:

If ( EndTime < StartTime; EndTime - StartTime + Time ( 24 * ( EndTime < StartTime) ; 0 ; 0 ); EndTime - StartTime)This will correct for the normal 24 hour times and detect the situation where we go over the 24 hour period into the next day and fix the time. Thanks to the other contributors as well.

Bob...

  • Author

Outstanding, that did it. Thanks so much for the information and quick response. Now on to the next opportunity. The actual calculation I used is:

If ( EndTime < StartTime; EndTime - StartTime + Time ( 24 * ( EndTime < StartTime) ; 0 ; 0 ); EndTime - StartTime)This will correct for the normal 24 hour times and detect the situation where we go over the 24 hour period into the next day and fix the time. Thanks to the other contributors as well.

Bob...

Just so you know,

If( EndTime < StartTime; EndTime - StartTime + Time( 24 * (EndTime < StartTime); 0; 0 ); EndTime - StartTime)

is equivalent to Comment's calc of

EndTime - StartTime + Time( 24 * (EndTime < StartTime); 0; 0 )

The test for EndTime < StartTime at the beginning is redundant since the Time portion will be zero unless EndTime < StartTime already.

Just so you know,

If( EndTime < StartTime; EndTime - StartTime + Time( 24 * (EndTime < StartTime); 0; 0 ); EndTime - StartTime)

is equivalent to Comment's calc of

EndTime - StartTime + Time( 24 * (EndTime < StartTime); 0; 0 )

The test for EndTime < StartTime at the beginning is redundant since the Time portion will be zero unless EndTime < StartTime already.

Just so you know,

If( EndTime < StartTime; EndTime - StartTime + Time( 24 * (EndTime < StartTime); 0; 0 ); EndTime - StartTime)

is equivalent to Comment's calc of

EndTime - StartTime + Time( 24 * (EndTime < StartTime); 0; 0 )

The test for EndTime < StartTime at the beginning is redundant since the Time portion will be zero unless EndTime < StartTime already.

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.