snowflake.snowpark.functions.to_timestamp¶
- snowflake.snowpark.functions.to_timestamp(e: ColumnOrName, fmt: Column | None = None) Column[source]¶
Converts an input expression into the corresponding timestamp.
Per default fmt is set to auto, which makes Snowflake detect the format automatically. With to_timestamp strings can be converted to timestamps. The format has to be specified according to the rules set forth in <https://docs.snowflake.com/en/sql-reference/functions-conversion#date-and-time-formats-in-conversion-functions>
- Example::
Another option is to convert dates into timestamps
- Example::
Integers can be converted into a timestamp as well, by providing optionally a scale as an integer as lined out in <https://docs.snowflake.com/en/sql-reference/functions/to_timestamp#usage-notes>. Currently Snowpark does support integers in the range of an 8-byte signed integer only.
- Example::
Larger numbers stored in a string can be also converted via this approach
- Example::