Le 28/02/2011 12:41, Kees Hink a écrit :
> 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
> _______________________________________________
> Product-Developers mailing list
> [email protected]
> https://lists.plone.org/mailman/listinfo/product-developers
I am used to use a patch to make python eat those dates as the
limitation is somehow complicated & historical, please see [3].
You can find it here [1] and/or use minitage or this custom package
(buildout) [2]

[1] -
https://github.com/minitage-dependencies/python-2.6/raw/master/patches/strftime-pre-1900.patch
[2] - https://github.com/minitage-dependencies/python-2.6
[3] - http://bugs.python.org/issue1777412

-- 
Cordialement,
kiorky
GPG Fingerprint: 

_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/product-developers

Reply via email to