Using PySpark,
I've got a string which looks like:
+-------------------------+
|2022-12-07050641 |
+-------------------------+
But need it to be in this format:
+-------------------------+
|2022-11-11 08:48:00.707 |
+-------------------------+
It seems that the to_timestamp()
function requires the formatting to be in the format of a timestamp.
I've been trying to use the to_timestamp()
function to convert the string to timestamp but the value then returns nulls. I figured its because of the format of the value (2022-12-07050641). How can I use regex to fix my value to be as the desired value?