[Zope] Your feedback: what should DateTime strftime() behavior be?

Brian Lloyd Brian@digicool.com
Tue, 25 Jul 2000 11:35:07 -0400


Hi all -

There has recently been some confusion over the expected 
behavior of various approaches to DateTime formatting in 
Zope regarding timezone representation. I would like to 
resolve this for the next release by making a proposal 
and asking you to reply to the list with a "vote":

  +1 == agree

  +/-0 == no strong opinion

  -1 == disagree

 
So then, here is the situation. In Zope 2.2 (and earlier), 
formatting a date using either:

  <dtml-var theDate fmt="%A, %B %d %Y, %H:%M:%S">

  <dtml-var "theDate.strftime('%A, %B %d %Y, %H:%M:%S')">

...would give you the date *formatted based on GMT rather than 
the timezone (usually local) representation of the object*. 
Simply doing:

  <dtml-var theDate>

...however, would print the date in the current timezone of 
the datetime object.

Many feel that this difference is unintuitive and a pain. The 
proposal is that both:

  <dtml-var theDate fmt="%A, %B %d %Y, %H:%M:%S">

  <dtml-var "theDate.strftime('%A, %B %d %Y, %H:%M:%S')">

...would be changed to apply the format to the current TZ 
representation of the object rather than convert to GMT. Of 
course, this could be a problem if there are people currently 
counting on the output being GMT, which is why we're putting it 
to a vote. If this change is made for 2.2.1, those who still 
wanted the output in GMT could just call the 'toZone()' method 
of the datetime object to get a GMT version before formatting:

  <dtml-var "theDate.toZone('GMT').strftime('%A, %B %d %Y, %H:%M:%S')">


What do you think?


Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com