Input_formats to DateTimeField

datetime, django, python

Solution

Write the definition like this:

start_time=forms.DateTimeField(input_formats=['%Y-%m-%d %H:%M'])

Note that input_formats is a list and the Y is upper case. That should work.

Problem

I have a DateTimeField : ``` start_time=forms.DateTimeField(input_formats='%y-%m-%d %H:%M') ``` and in html ``` {{form.start_time}} ``` but no matter what i entre in th field, like: 2013-07-07 19:00 it will always give me an error : enter valid date/time, what is worng here? Thanks in Advance

Original source