The number of hours between times.

Hours = SRP_Time("HourSpan", FromTime, ToTime, Fractional)

Returns

The number of hours between two times

Parameters

ParameterDescription
FromTimeA starting time in OI internal format. (REQUIRED)
ToTimeAn ending time in OI internal format. (REQUIRED)
FractionalDetermines if the span should be in whole hours or fractional hours. (OPTIONAL)

Remarks

The "HourSpan" service calculates the number of hours between two times. The result will be positive if the starting time comes before the ending time and negative if the ending time comes first.

If Fractional is set to 1, which is the default, you will get a decimal number if the minute and second are not the same for each time. If you want whole hours only, set Fractional to 0.

Examples

// Get the number of hours between two times
From = SRP_Time("Parse", "7:51:43am", "h:mm:sstt")
To = SRP_Time("Parse", "12:41:08pm", "h:mm:sstt")
Hours = SRP_Time("HourSpan", From, To)

// Get the number of whole hours
Hours = SRP_Time("HourSpan", From, To, 0)
  • No labels