sim_step()

Returns the simulation time step corresponding to the given timestamp.

Synopsis

sim_step(year, month, day)
sim_step(year, month, day, hour)

Description

Returns the simulation time step corresponding to the given date and hour. The hour parameter is optional; sim_step(year, month, day) is equivalent to sim_step(year, month, day, 0)

Parameters

year

The year, as a four digit number.

month

The month, as a two digit number (if less than 10, add a preceeding 0 to make it two digits).

day

The day, as a two digit number (if less than 10, add a preceeding 0 to make it two digits).

hour

The hour, as a two digit number (if less than 10, add a preceeding 0 to make it two digits).

Returns

The integer value of the simulation time step at the given day or hour.

Examples

The following returns the simulation time step corresponding to June 16, 2020 at 7pm:

sim_step(2020, 6, 16, 19)

The following wait command would wait until the simulation time step corresponding to Aug 12 at 2am during the year represented by the variable Yr:

wait(sim_step(Yr, 8, 12, 2) - now)

See Also

now, sim_day, sim_run,