Verify yourself to prove that you are not a ROBOT! After verification the page will apear. Thanks for understanding.
I am trying to figure out how to accept am/pm as a time format in Django using a DateTime field, but I am having some trouble. I have tried setting it like this in my forms.py file
pickup_date_time_from = DateTimeField(input_formats=["%m/%d/%Y %I:%M %p"])
with the following data:
12/31/2017 02:40 pm
However, I get a validation error when submitting the form:
(Hidden field pickup_date_time_from) Enter a valid date/time.
I have also tried setting a global variable in settings.py as the documentation states:
DATETIME_INPUT_FORMATS = ['%m/%d/%y %I:%M %p']
What does work is if I submit the data without the am/pm, but the output is
Any other options?