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

kiorky kiorky at cryptelium.net
Fri Mar 4 19:17:19 UTC 2011


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
> Product-Developers at lists.plone.org
> 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: 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20110304/ec9270af/attachment-0002.html>


More information about the Product-Developers mailing list