Reformatting dates in python
Question: I'm stuck with this python problem, I have a date in the format of month-day-
year and I need to change it to year-month-day format


Answer: 
    >>> import datetime
    >>> datetime.datetime.strptime("06/03/2015", "%m/%d/%Y").strftime("%Y-%m-%d")
    '2015-06-03'
    

* * *

This takes a date (June 3, 2015 in this case) as a string and parses it to a
datetime object using
[`strptime`](https://docs.python.org/2/library/datetime.html#datetime.datetime.strptime).
It then converts that to a string in the format you requested (YYYY-mm-dd)
using
[`strftime`](https://docs.python.org/2/library/datetime.html#datetime.datetime.strftime)

