>From my brief reading of the some docs (eg postgresql) it looks like
dates with less than 4 years do need to be prefixed with a zero, in
the standard date format (some databases let you set different
formats). But since python doesn't output a 0, I can see why its going
wrong:

>>> datetime(999,1,1,1).year
999

Interestingly sqlite uses standard strftime
http://www.sqlite.org/lang_datefunc.html:

%Y              year: 0000-9999

I thought the answer might be to use strftime but:

>>> datetime(999,1,1,1).strftime('%Y')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: year=999 is before 1900; the datetime strftime() methods
require year >= 1900

Which is this bug: http://bugs.python.org/issue1777412

This isn't a problem that I can imagine many people have run into, so
sounds like a bug needing a patch. Good luck!

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to