to_j_local_date
to_j_local_date
converts a date-time value into a Java LocalDate
, which is a date without a time or time zone.
info
In query strings, users should choose the built-in function toLocalDate
instead of to_j_local_date
. For more information, see:
Syntax
to_j_local_date(
dt: Union[None, LocalDate, str, datetime.date, datetime.time, datetime.datetime, numpy.datetime64, pandas.Timestamp]
) -> LocalDate
Parameters
Parameter | Type | Description |
---|---|---|
dt | Union[None, LocalDate, str, datetime.date, datetime.time, datetime.datetime, numpy.datetime64, pandas.Timestamp] | The date-time value to convert to a Java LocalDate. A string in the form of |
Returns
Returns a LocalDate
.
Examples
from deephaven.time import to_j_local_date, dh_today
ld = to_j_local_date(dh_today())
print(ld)
- Log
from deephaven.time import to_j_local_date
import numpy as np
import pandas as pd
import datetime
dt_date = datetime.date(2024, 9, 2)
dt_dt = datetime.datetime(2024, 9, 2)
np_dt64 = np.datetime64(12, "h")
pd_dt = pd.Timestamp("2024-11-11")
dt_date_ld = to_j_local_date(dt_date)
dt_dt_ld = to_j_local_date(dt_dt)
np_dt64_ld = to_j_local_date(np_dt64)
pd_dt_ld = to_j_local_date(pd_dt)
date_str_ld = to_j_local_date("2024-10-12")
print(dt_date_ld)
print(dt_dt_ld)
print(np_dt64_ld)
print(pd_dt_ld)
print(date_str_ld)