steps_between()

The number of hours between two timestamps.

Synopsis

steps_between(timestamp1, timestamp2)

Description

Returns the number of hours between the given timestamps.

The results are accurate for timestamps between the start_date and end_date defined for the model.

Timestamps outside the simulation period results in arbitrary large values. For example, if timestamp1 occurs prior to start_date or timestamp2 occurs after end_date, then the function may return a value such as 999999.

Parameters

timestamp1

Expression that evaluates to a number of the form YYYYMMDDHH or YYYYMMDD.

timestamp2

Expression that evaluates to a number of the form YYYYMMDDHH or YYYYMMDD.

Returns

Returns the number of hours between the two timestamps.

Errors

If either argument represents an invalid timestamp, a run-time error will occur and the simulation will terminate.

Examples

wait(steps_between(2020010100, 2021052813))

See Also

wait()