[Zope-dev] Re: Changing DateTime to use pytz

Laurence Rowe l at lrowe.co.uk
Fri Oct 5 09:34:34 EDT 2007


I've tested my patch (datetime.datetime support) against Amos's branch 
and it applies cleanly and all tests pass.

It seems though that the new timezones are not used much... doing a 
DateTime() gives me DateTime('2007/10/05 14:20:27.204176 GMT+1') (with 
my pathc applied too). Looking up tz = d._tzinfo[d.timezone()] gives me 
an old style timezone, as _tz is 'GMT+1'.

It would be very useful to be able to get pytz tzinfo for a DateTime 
object. It would allow me to return a timezone aware datetime.datetime 
from asdatetime().

Ideally the old names should be mapped onto pytz timezones.

Laurence

Laurence Rowe wrote:
> I've been working on this too today (well datetime handling anyway). 
> Please see my patch at https://bugs.launchpad.net/zope2/+bug/149060
> 
> Laurence
> 
> 
> Amos Latteier wrote:
>> Hi,
>>
>> I wanted to let folks know that I've created the amos-datetime-pytz
>> branch with my changes.
>>
>> Please let me know when/if you'd like me to merge this to the trunk.
>>
>> Of course I'm also happy to receive any criticism or comments on the 
>> changes.
>>
>> Thanks!
>>
>> -Amos
>> _______________________________________________
>> Zope-Dev maillist  -  Zope-Dev at zope.org
>> http://mail.zope.org/mailman/listinfo/zope-dev
>> **  No cross posts or HTML encoding!  **
>> (Related lists -  http://mail.zope.org/mailman/listinfo/zope-announce
>>  http://mail.zope.org/mailman/listinfo/zope )
>>
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope )
> 



More information about the Zope-Dev mailing list