datetime_at_midnight
datetime_at_midnight
returns a DateTime for the requested DateTime at midnight in the specified time zone.
Syntax
datetime_at_midnight(dt, tz)
Parameters
Parameter | Type | Description |
---|---|---|
dt | DateTime | The DateTime to convert to midnight |
tz | TimeZone | TimeZone for which the new value at midnight should be calculated |
Returns
Returns the DateTime at midnight in the time zone
Examples
from deephaven.time import to_datetime, datetime_at_midnight, TimeZone
datetime = to_datetime("2022-01-01T00:00:00 NY")
datetime_midnight = datetime_at_midnight(datetime, TimeZone.NY)
print(datetime_midnight)
- Log