Re: [Zope] DateTime strftime problem

2005-11-09 Thread Chris Withers
Jürgen Herrmann wrote: hmm, could i please have a comment on my real question? is it correct, to expect the abovementioned retval from strftime in this case? if so, i'll change the testcase and fix the two outstanding issues with dates 1900 or 2035 and open a collector issue with the patches

Re: [Zope] DateTime strftime problem

2005-11-08 Thread Jürgen Herrmann
[ Andreas Jung wrote:] --On 7. November 2005 15:36:26 +0100 Andreas Jung [EMAIL PROTECTED] wrote: --On 7. November 2005 15:22:56 +0100 Jürgen Herrmann [EMAIL PROTECTED] wrote: 2. if this works as expected, why not make DateTime a wrapper around python datetime objects? is DateTime

Re: [Zope] DateTime strftime problem

2005-11-08 Thread Jürgen Herrmann
[ Jürgen Herrmann wrote:] i looked at the source of DateTime::strftime(), surpirse, surprise :) strftime uses python's datetime class and it's strftime method! but no care is taken at this time for timezone information, so i decided to code a tzinfo subclass for datetime that can represent

Re: [Zope] DateTime strftime problem

2005-11-08 Thread Chris Withers
Andreas Jung wrote: This idea had been discussed already for Python 2.4 or Python 2.5 I think. Since 100% compatibility could not be guaranteed, What? you mean it wouldn't be broken? ;-) Chris -- Simplistix - Content Management, Zope Python Consulting -

Re: [Zope] DateTime strftime problem

2005-11-08 Thread Chris Withers
Jürgen Herrmann wrote: d = DateTime('2005/04/03 02:01 UTC') d.toZone('GMT+1').strftime('%Y/%m/%d %H:%M %Z') '2005/04/03 03:01 GMT+0100' is this correct? if so, the i would tend to say, the testcase was written to pass with wrong strftime() behaviour. That would be entirely unsuprising

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Andreas Jung
--On 7. November 2005 14:21:32 +0100 Jürgen Herrmann [EMAIL PROTECTED] wrote: hi all! DateTime('2005/04/03 02:01 GMT').toZone('GMT-4') prints: 2005/04/02 22:01:00 GMT-4 ...which is what i expected - DateTime('2005/04/03

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Jürgen Herrmann
[ Andreas Jung wrote:] --On 7. November 2005 14:41:43 +0100 Jürgen Herrmann zope 2.8.3, should i upgrade to 2.8.4 first? This is possibly related to bug #1780 (and other related timezone bugs). Unfortunately the timezone handling in Zope was and is always a mess...unlikely that it will

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Andreas Jung
--On 7. November 2005 14:59:44 +0100 Jürgen Herrmann [EMAIL PROTECTED] wrote: then i will fix it, if i can. i need that functionality, because we have users from different time zones that access a shared calendar. The if i can might be the reason why is not fixed yet :-) But feel free

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Jürgen Herrmann
[ Andreas Jung wrote:] --On 7. November 2005 14:41:43 +0100 Jürgen Herrmann zope 2.8.3, should i upgrade to 2.8.4 first? This is possibly related to bug #1780 (and other related timezone bugs). Unfortunately the timezone handling in Zope was and is always a mess...unlikely that it will

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Lennart Regebro
On 11/7/05, Jürgen Herrmann [EMAIL PROTECTED] wrote: then i will fix it, if i can. i need that functionality, because we have users from different time zones that access a shared calendar. I don't know if this helps, but it might: Python had a good module called datetime. Most likely, you

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Jürgen Herrmann
[ Lennart Regebro wrote:] On 11/7/05, Jürgen Herrmann [EMAIL PROTECTED] wrote: then i will fix it, if i can. i need that functionality, because we have users from different time zones that access a shared calendar. I don't know if this helps, but it might: Python had a good module called

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Andreas Jung
--On 7. November 2005 15:22:56 +0100 Jürgen Herrmann [EMAIL PROTECTED] wrote: 2. if this works as expected, why not make DateTime a wrapper around python datetime objects? is DateTime optimized for storage in the zodb (maybe a separate question to the zodb-dev list)? what was the intention

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Lennart Regebro
On 11/7/05, Jürgen Herrmann [EMAIL PROTECTED] wrote: 1. what do you mean by HAD? seems to be there still and looks quite useable. I mean has. :) 2. if this works as expected, why not make DateTime a wrapper around python datetime objects? Because that is a lot of work to make that work in

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Andreas Jung
--On 7. November 2005 15:36:26 +0100 Andreas Jung [EMAIL PROTECTED] wrote: --On 7. November 2005 15:22:56 +0100 Jürgen Herrmann [EMAIL PROTECTED] wrote: 2. if this works as expected, why not make DateTime a wrapper around python datetime objects? is DateTime optimized for storage in the

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Ron Bickers
On Mon November 7 2005 08:21 am, Jürgen Herrmann wrote: DateTime('2005/04/03 02:01 GMT').toZone('GMT-4') prints: 2005/04/02 22:01:00 GMT-4 ...which is what i expected - DateTime('2005/04/03 02:01 GMT').toZone('GMT-4')\

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Ron Bickers
On Mon November 7 2005 12:15 pm, Ron Bickers wrote: dt = DateTime('2005/04/03 02:01 GMT').toZone('GMT-4') '%s/%s/%s %s:%s %s' % (dt.year(), dt.month(), dt.day(), dt.hour(), dt.minute, dt.timezone()) '%s/%s/%s %s:%s:%s %s' % (dt.parts()) Uh... you'll probably

Re: [Zope] DateTime strftime problem

2005-11-07 Thread Ron Bickers
On Mon November 7 2005 12:15 pm, Ron Bickers wrote: dt = DateTime('2005/04/03 02:01 GMT').toZone('GMT-4') '%s/%s/%s %s:%s %s' % (dt.year(), dt.month(), dt.day(), dt.hour(), dt.minute, dt.timezone()) Oops. A (hopefully obvious) typo... should be dt.minute() --