to_datetime
to_datetime
converts a Java date-time to a datetime.datetime
.
danger
to_datetime
should never be used in query strings.
Syntax
to_datetime(dt: Union[None, Instant, ZonedDateTime]) -> datetime.datetime
Parameters
Parameter | Type | Description |
---|---|---|
dt | Union[None, Instant, ZonedDateTime] | A Java date-time to convert to a |
Returns
Returns a datetime.datetime
.
Examples
from deephaven.time import dh_now, to_datetime, to_j_zdt
java_date = dh_now()
zdt = to_j_zdt("2024-03-22T11:11:11.23142 UTC")
datetime = to_datetime(java_date)
datetime_from_zdt = to_datetime(zdt)
print(datetime)
print(datetime_from_zdt)
- Log