You are viewing documentation about an older version (1.5.0). View latest version

snowflake.snowpark.functions.timestamp_ltz_from_parts

snowflake.snowpark.functions.timestamp_ltz_from_parts(year: Column | str | int, month: Column | str | int, day: Column | str | int, hour: Column | str | int, minute: Column | str | int, second: Column | str | int, nanoseconds: Column | str | int | None = None) Column[source]

Creates a timestamp from individual numeric components.

Example:

>>> import datetime
>>> df = session.create_dataframe(
...     [[2022, 4, 1, 11, 11, 0], [2022, 3, 31, 11, 11, 0]],
...     schema=["year", "month", "day", "hour", "minute", "second"],
... )
>>> df.select(timestamp_ltz_from_parts(
...     "year", "month", "day", "hour", "minute", "second"
... ).alias("TIMESTAMP_LTZ_FROM_PARTS")).collect()
[Row(TIMESTAMP_LTZ_FROM_PARTS=datetime.datetime(2022, 4, 1, 11, 11, tzinfo=<DstTzInfo 'America/Los_Angeles' PDT-1 day, 17:00:00 DST>)), Row(TIMESTAMP_LTZ_FROM_PARTS=datetime.datetime(2022, 3, 31, 11, 11, tzinfo=<DstTzInfo 'America/Los_Angeles' PDT-1 day, 17:00:00 DST>))]
Copy