I use python dateutil to parse string to date:
parse(' 19 2015 '.strip(), fuzzy=True) But this throws an error:
Traceback (most recent call last): File "M:/BitNami_Djangostack/django_mongo_test/glr_test/example.py", line 179, in <module> print('parse(month_to_eng_replace', parse(' 19 2015 ', fuzzy=True)) File "M:\WinPython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages\dateutil\parser.py", line 743, in parse return DEFAULTPARSER.parse(timestr, **kwargs) File "M:\WinPython-64bit-3.4.3.2\python-3.4.3.amd64\lib\site-packages\dateutil\parser.py", line 310, in parse ret = default.replace(**repl) ValueError: month must be in 1..12 In other answer on stackoverflow i read that option fuzzy=True ignores uknown tokens, but how do i explain that 19 is day, not month number, and i provide only two: day and year? option dayfirst=True not working for this.
time.strptimefunction (or thedatetimeequivalent)?