storage.utils.round_datetime()

Find closest multiple of interval to given time.

Usage

Source

storage.utils.round_datetime(
    dt,
    interval,
)

Parameters

dt : datetime The datetime to round. interval : Union[int, float, timedelta] The interval to which to round the datetime.

Returns

datetime The rounded datetime.