I am trying to add a datetime object to a person. Whenever the year of birth is less than 1942, I get a strange DataError: unable to parse time error when reading data back from the database.
class Person(models.Model): """A simple class to hold the person info """ name = models.CharField(max_length=100) born = models.DateTimeField(blank=True, null=True)
Whenever I try to add a born datetime object to a person born in 1929, and then try to read it, it fails.
Let me repeat the iteration that the data insert works fine, but it fails while reading. I guess something is wrong inside the database.
I did a test suite and found out that it fails when I add a person born in or before 1940. It gives a DataError: unable to parse time
I am using PostgreSQL.
Any help would be greatly appreciated. Thanks.
source share