Easily prettify dates and datetimes with str()


In [6]:
from datetime import date, datetime

In [10]:
today=date.today()
right_now=datetime.now()
(today, right_now)


Out[10]:
(datetime.date(2017, 1, 4), datetime.datetime(2017, 1, 4, 15, 59, 25, 191057))

In [11]:
(str(today), str(right_now))


Out[11]:
('2017-01-04', '2017-01-04 15:59:25.191057')