to_np_datetime64
to_np_datetime64
converts a Java date-time to a numpy.datetime64
.
danger
Avoid deephaven.time
functions in query strings. Because deephaven.time
provides functions that convert between Python and Java types, every call crosses the Python-Java boundary, which slows performance. For more information, see:
Syntax
to_np_datetime64(dt: Union[None, Instant, ZonedDateTime]) -> numpy.datetime64
Parameters
Parameter | Type | Description |
---|---|---|
dt | Union[None, Instant, ZonedDateTime] | A Java date-time to convert to a |
Returns
Returns a numpy.datetime64
.
Examples
from deephaven.time import dh_now, to_np_datetime64
np_now = to_np_datetime64(dh_now())
print(np_now, type(np_now))
- Log
from deephaven.time import dh_now, to_np_datetime64, to_j_zdt
zdt = to_j_zdt("2024-05-22 ET")
np_dt = to_np_datetime64(zdt)
print(np_dt)
- Log