snowflake.snowpark.functions.unix_timestamp¶
- snowflake.snowpark.functions.unix_timestamp(e: Union[Column, str], fmt: Optional[Column] = None) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/functions.py#L9974-L10003)¶
Converts a timestamp or a timestamp string to Unix time stamp (in seconds).
Example:
>>> import datetime >>> df = session.create_dataframe([["2013-05-08T23:39:20.123-07:00"]], schema=["ts_col"]) >>> df.select(unix_timestamp(col("ts_col")).alias("unix_time")).show() --------------- |"UNIX_TIME" | --------------- |1368056360 | ---------------