Skip to main content
Version: Python

to_j_instant

to_j_instant converts a date-time value to Java Instant.

info

In query strings, users should choose the built-in function toInstant instead of to_j_instant. For more information, see:

Syntax

to_j_instant(
dt: Union[None, Instant, int, str, datetime.datetime, numpy.datetime64, pandas.Timestamp]
) -> Instant

Parameters

ParameterTypeDescription
dtUnion[None, Instant, int, str, datetime.datetime, numpy.datetime64, pandas.Timestamp]

A date-time value to convert to a Java Instant.

Instant strings should be formatted according to the ISO-8601 standard, which is yyyy-MM-ddThh:mm:ss[.SSSSSSSSS] TZ, where TZ is the time zone offset from UTC; e.g., 2022-01-01T00:00:00 ET.

Returns

Returns an Instant.

Examples

from deephaven.time import to_j_instant

datetime = to_j_instant("2022-01-01T00:00:00 ET")
print(datetime)