[prev in list] [next in list] [prev in thread] [next in thread]
List: zope-dev
Subject: Re: [Zope-dev] [Bug] DateTime(string) uses GMT as timezone
From: Steve Alexander <steve () cat-box ! net>
Date: 2001-09-30 21:08:51
[Download RAW message or body]
Dieter Maurer wrote:
> Unfortunately
>
> DateTime(year,month,day) != DateTime("%d-%d-%d" % (year,month,day))
>
> The former uses the local timezone (which I think is right)
> while the latter uses GMT+0 (which seems not right).
>
> Thinks are quite bad, as the latter is used to convert
> ":date" form values into DateTime objects.
See also here:
http://lists.zope.org/pipermail/zope-dev/2001-August/012974.html
----
I get different times from a string, depending whether I use '-' or '/'
as a date delimiter.
>>> from DateTime.DateTime import DateTime
>>> DateTime('2001-08-20').pCommonZ()
'Aug. 20, 2001 12:00 am GMT+0'
>>> DateTime('2001/08/20').pCommonZ()
'Aug. 20, 2001 12:00 am GMT+1'
>>>
I find the difference a tad surprising.
Is this a bug or a feature?
If it's a bug, I'll work on a fix.
I'm guessing this is a feature; perhaps using the '-' delimiter suggests
I'm trying to use ISO formatting.
I'm running this in a GMT+1 timezone btw.
Zope latest from CVS, Python 2.1.
----
I never got a reply as to whether it was a bug or a feature, so I didn't
work on a fix.
--
Steve Alexander
Software Engineer
Cat-Box limited
_______________________________________________
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 )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic