I have a column with datetime UTC date
2020-01-01 00:00:00+00:00
Can someone help me to convert it to just datetime64 for eg:
2020-01-01
I have a column with datetime UTC date
2020-01-01 00:00:00+00:00
Can someone help me to convert it to just datetime64 for eg:
2020-01-01
if you use pandas (this seems to be the case) you can change it like that:
df.dates.apply(lambda x: x.date()) # where dates is your datetime column
Try the datetime
package with Python 3.2+.
import datetime
a='2020-01-01 00:00:00+00:00'
print (datetime.datetime.strptime(a,'%Y-%m-%d %H:%M:%S%z').strftime('%Y-%m-%d'))