I am having trouble converting a python datetime64 object into a string. For example:
datetime64
t = numpy.datetime64(\'2012-06-30T20:00:00.000000000-0400\
If you don't want to do that conversion gobbledygook and are ok with just one date format, this was the best solution for me
str(t)[:10] Out[11]: '2012-07-01'
As noted this works for pandas too
df['d'].astype(str).str[:10] df['d'].dt.strftime('%Y-%m-%d') # equivalent