preheat_open.time.timestep_start

preheat_open.time.timestep_start(step, t)

Computes the start of the current timestep.

Parameters:
  • step (Enum | str) – The time resolution step.

  • t (datetime) – The datetime for which to evaluate the step start.

Returns:

The start time of the timestep.

Return type:

datetime

Examples:
>>> from datetime import datetime
>>> from preheat_open.time import timestep_start, TimeResolution
>>> t = datetime(2023, 1, 1, 12, 34, 56)
>>> print(timestep_start(TimeResolution.HOUR, t))
2023-01-01 12:00:00