[Django]-Parsing dates with django utils parse_date

9👍

I’m surprised because django has this function and it just fails silently. But anyway, I played with it and it should be:

parse_date("2016-07-13")

I don’t see it well documented and I still use the plain old strptime to do date/datetime conversion:

import datetime
datetime.datetime.strptime('13/07/2016', "%d/%m/%Y").date()

Leave a comment