'Pyspark SQL : Converting a string to timestamp custom format
I want to convert a input of string datatype (which is MMYYYY format - has only month & year) to a custom format in timestamp.
In the output the input string should be converted into timestamp having 00 hours, 00 minutes, 00 seconds and 000 milliseconds and '01' should be concatenated as the date.
For example : Input string is : "102003" then the Output should be : 2003-10-01 00:00:00.000 (in timestamp format)
This is what I have tried so far :
date_format(to_timestamp('01' || COL_1), 'DDMMYYYY')
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
