Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django DateTimeField ValidationError: value has an invalid format

I'm getting a validation error when trying to store a date time in a django DateTimeField.

The format I'm trying to save is below, together with the error. :

django.core.exceptions.ValidationError: ["'Mon, 23 May 2016 08:30:15 GMT' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][T

In my django settings I have:

DATE_INPUT_FORMATS = ("%d %b %Y", )

Should I be converting the format before saving or can I add to DATE_INPUT_FORMATS

like image 556
Yunti Avatar asked May 23 '16 08:05

Yunti


1 Answers

Django references: DateTimeField

Here's the answer: StackOverflow Answer Reference

like image 67
ImportError Avatar answered Sep 24 '22 23:09

ImportError