I am trying to convert one pyspark column in string format to timestamp format
I tried as below but I get null values for that column.
Thanks
Example data: 06/19/17 00:00:00
df = df.withColumn("date", to_timestamp(col("date"), "MM/dd/yyy HHmm"))
When I tried casting as below
df = df.withColumn("date",(col("invoice_date").cast(TimestampType())))
output: 2017-06-19T00:00:00.000+0000
Expected output:
06/19/17 00:00:00