Xbasic

*hours_between Function

Syntax

dim Result as N = *HOURS_BETWEEN(t1 as T, t2 as T)

Arguments

t1Time

A datetime value.

t2Time

A datetime value

Returns

ResultNumeric

Returns the hours between two dates or times. If t2 is a date or time later than t1, *HOURS_BETWEEN will return a negative value.

Description

Return difference of hours between two dates or times.

Example

dim time1 as t = now()
dim time2 as t = *add_hours(time1, 9)

? *hours_between(time2, time1)
= 9

? *hours_between(time1, time2)
= -9

See Also