I have a date string like '06/21/2021 9:27 AM', and I want to convert it into timestamp type in pyspark.
I have tried this approach, along with others, and it always seems to return null.
df = df.select(
from_unixtime(unix_timestamp('date_string', 'MM/dd/yyyy hh:mm:ss a')).cast(TimestampType())
)
Has anyone successfully converted this string format into a timestamp format?