snowflake.snowpark.functions.timestamp_ltz_from_parts¶
- snowflake.snowpark.functions.timestamp_ltz_from_parts(year: Union[Column, str, int], month: Union[Column, str, int], day: Union[Column, str, int], hour: Union[Column, str, int], minute: Union[Column, str, int], second: Union[Column, str, int], nanoseconds: Optional[Union[Column, str, int]] = None) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/functions.py#L5918-L5964)¶
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>))]