[Zope3-dev] mini-RFC: times and timezones
Stephan Richter
srichter at cosmos.phy.tufts.edu
Sun Feb 27 05:52:23 EST 2005
On Saturday 26 February 2005 18:23, Gary Poster wrote:
> >> * Views should generally display dates (stored with a UTC timezone)
> >> using something like this:
> >> formatter = request.locale.dates.getFormatter('dateTime',
> >> length='short')
> >> tz = zope.interface.common.tzinfo.ITZInfo(request)
> >> return formatter.format(zope.i18n.switchTimeZones(date, tz)
> >
> > This looks like a mouthful. Can we invent an obvious way to display
> > dates and times without having to remember weird three-line
> > incantations? (Can anyone remember how to open a text file in Java
> > without looking it up?)
>
> A good point. Before talking about it more, for what it's worth,
> here's the current revision of the three lines:
>
> from zope.interface.common.tzinfo import ITZInfo
> formatter = request.locale.dates.getFormatter('dateTime',
> length='short')
Have you read my book? :-)
I have outlined a TALES formatting namespace there:
<div tal:content="context/zope:modified/format:fullDateTime">
(http://dev.zope.org/Zope3/Zope3Book/talesns.html)
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
More information about the Zope3-dev
mailing list