[Product-Developers] dates with years before 1900: how to implement?

Kees Hink hink at gw20e.com
Mon Feb 28 11:41:22 UTC 2011


For a site with historical references, we're going to store a date on content
types. However, Zope's 'DateTime' only supports dates from 1900 [1] whereas the
site may refer to a long time before that. It might even be that we have dates
where the year is a negative number. (Not billions, but maybe tens of thousands.)

Python's 'datetime' goes back as far as the year 1, so even that may not be
sufficient, and strftime doesn't work for years before 1901 [2], so that's not
a big help either.

I'm guessing that using separate fields for year, month and day will be a good
enough solution for us, for now.

Is there anyone who has experience with this use case, and what did you do?
Kees

[1]
http://www.zope.org/Documentation/Books/ZopeBook/2_5_edition/AppendixB.stx#DateTime
[2] http://docs.python.org/library/datetime.html



More information about the Product-Developers mailing list