I need to convert a string into a date format, for this the string format I have is something like this:
2021-01-07 11:17:49.385820+00:00
and what I am doing is the following:
format = "yyyy-MM-dd HH:mm:ss.SSSSSS+ZZ:ZZ"
level_1_data_df = level_1_data_value_df
.select(
"level_1_data.*"
).withColumn("time2", to_timestamp(col("time"), format))
but the result of the new field is null, any ideas?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…