My datetime
is in following format:
visit_dts |web_datetime|
+--------------------+------------+
| 5/1/2018 3:48:14 PM| null|
Based on answer provided here, I am using following query to convert string into datetime
format:
web1 = web1.withColumn("web_datetime", from_unixtime(unix_timestamp(col("visit_dts"), "%mm/%dd/%YY %I:%M:%S %p")))
But it is not working. Any lead would be great.