Suppose I have a csv
with a timestamp
but the format is not defined. It can be of any format with any separator like -
mm/dd/yyyy hh:mm
or dd/mm/yyyy hh:mm:ss
or mm-dd-yyyy hh:mm
or dd-mm-yyyy hh:mm:ss
or just like that.
I am trying to parse dates of any format.
Here:
dateparse = lambda dates: datetime.strptime(dates, '%m/%d/%Y %H:%M')
We have defined to parse dates in this format: %m/%d/%Y %H:%M
If anyone can give any valuable suggestion then it will be helpful.