[Zope-dev] DateTime: ISO date range limited

Andreas Jung Andreas Jung" <andreas@zope.com
Mon, 29 Oct 2001 10:19:12 -0500


This is a limitation of time.mktime() in Python but not of Zope.
The ValueError seems not to be documented in the Python docs.

Andreas
----- Original Message -----
From: "Jens Quade" <jq@jquade.de>
To: <zope-dev@zope.org>
Sent: Monday, October 29, 2001 09:38
Subject: [Zope-dev] DateTime: ISO date range limited


> Hi,
>
> I'd expect the following shouldn't raise an exception:
>
> [current Zope CVS]
>
> >>> x=DateTime(1000,1,1)
> >>> y=DateTime(x.HTML4())
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File
"/home/jens/work/NGServer/dcCVS/Zope/lib/python/DateTime/DateTime.py", line
716, in __init__
>     yr,mo,dy,hr,mn,sc,tz=self._parse_iso8601(arg)
>   File
"/home/jens/work/NGServer/dcCVS/Zope/lib/python/DateTime/DateTime.py", line
1624, in _parse_iso8601
>     return self.__parse_iso8601(s)
>   File
"/home/jens/work/NGServer/dcCVS/Zope/lib/python/DateTime/DateTime.py", line
1661, in __parse_iso8601
>     ts = mktime((year,month,day,hour,minute,seconds,0,0,0))
> ValueError: year out of range
> >>>
>
> The variable 'ts' calculated using 'mktime' is *not* used in the
> result of '__parse_iso8601', so I wonder why the call exists.
>
> jens
>
>
>
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>