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

snowflake.snowpark.functions.timestamp_ltz_from_parts¶

snowflake.snowpark.functions.timestamp_ltz_from_parts(year: ColumnOrName | int, month: ColumnOrName | int, day: ColumnOrName | int, hour: ColumnOrName | int, minute: ColumnOrName | int, second: ColumnOrName | int, nanoseconds: ColumnOrName | 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