问题
I am trying to convert this column of my dataframe 'Sat Feb 02 12:50:00 IST 2019' to regular datetime format ie(2019-05-02 12:00:00) in python
How do i convert all the rows to this format?
回答1:
Assuming you don't need your datetime Python object to be timezone aware, you could just use strptime
as follows:
dt = "Sat Feb 02 12:50:00 IST 2019"
out = datetime.strptime(dt, "%a %b %d %H:%M:%S IST %Y")
print(out)
This prints:
2019-02-02 12:50:00
来源:https://stackoverflow.com/questions/62370051/how-to-conver-sat-feb-02-125000-ist-2019-to-regular-datetime-in-python