snowflake.snowpark.functions.second¶
- snowflake.snowpark.functions.second(e: Union[Column, str]) Column [source]¶
Extracts the second from a date or timestamp.
Example:
>>> import datetime >>> df = session.create_dataframe([ ... datetime.datetime.strptime("2020-05-01 13:11:20.000", "%Y-%m-%d %H:%M:%S.%f"), ... datetime.datetime.strptime("2020-08-21 01:30:05.000", "%Y-%m-%d %H:%M:%S.%f") ... ], schema=["a"]) >>> df.select(second("a")).collect() [Row(SECOND("A")=20), Row(SECOND("A")=5)]