m3l7
10/13/2014 - 8:26 PM

views.py

            date_formats = ['%m-%d-%Y','%Y-%m-%d']

            for date_format in date_formats:
                try:
                    match = time.strptime(search_query, date_format)
                except:
                    continue
                print "we have a date!"
                break