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

Rob Miller rob.at.kalistra.dot.com@zope.org
Tue, 25 Jul 2000 10:54:51 -0700


+1

On Tue, 25 Jul 2000, Brian Lloyd wrote:
> 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 
> uthe timezone (usually local) representation of the object*. 
> Simply doing:
> 
>   <dtml-var theDate>
> 
> ...however, would print the date in the current timezone of 
> tthe 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 
> rrepresentation 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 
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )