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

snowflake.snowpark.functions.unix_timestamp¶

snowflake.snowpark.functions.unix_timestamp(e: ColumnOrName, fmt: Column | None = None) → Column[source]¶

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   |
---------------
Copy