#Function
to_timestamp() converts a column of strings (in a specified format) into a timestamp type column.

Syntax: -

from pyspark.sql.functions import to_timestamp

to_timestamp(col, format=None)

Example: -

df.withColumn('timestamp_column', to_timestamp(df['date_column'], 'yyyy-MM-dd HH:mm:ss'))