[Zope3-dev] datetimeutils: add localize datetime?
Sidnei da Silva
sidnei at awkly.org
Tue Feb 1 07:53:28 EST 2005
On Tue, Feb 01, 2005 at 07:12:25AM -0500, Stephan Richter wrote:
| On Tuesday 01 February 2005 07:00, Sidnei da Silva wrote:
| > It looks like it extensible enough to handle the funkiest date
| > strings, and has full support for timezones, even reading timezone
| > info from .ics (iCalendar) files and from timezone files on
| > the operating system.
|
| Any parser not based on locales is not acceptable for a server-system like
| Zope. The ICU system, which we use, originated out of years of experience
| with Java at Sun and IBM.
|
| How would the Parser handle:
|
| "Dienstag, 1. Februar 2005 12:01:00"
| "Jeudi, Fevrier 1, 2005"
|
| Parsers should really just accept datetimes that you want them to accept.
| There is an inherent ambiguity. For example, it became fashion in the US
| (sigh) to use the dot for dates sometimes. So is "1.2.2005" January 2nd, 2005
| or February 1st, 2005?
|
| BTW, I will veto (as much as I can) any inclusion of such guessin g functions.
| It is just not right.
It's not just guessing-based. It has documented behaviour [1] and tests,
and the parsing is pluggable [2], which I think it's a must for any such
functionality.
We could write a parserinfo adapter or utility that would use the ICU
to handle non-US date strings.
Gustavo is usually hanging out on #zope3-dev under the nick
'niemeyer', so I'm sure he would be pleased to help us with this.
Seems like there was a long thread [3] on python-dev about inclusion of
dateutil in the std lib, not sure about the outcome though.
[1] https://moin.conectiva.com.br/DateUtil#head-fe951d30a583390a274f57d3e881611e5ae207a5
[2] parserinfo
This parameter allows one to change how the string is parsed, by
using a different parserinfo class instance. Using it you may, for
example, intenationalize the parser strings, or make it ignore
additional words.
[3] http://aspn.activestate.com/ASPN/Mail/Message/python-dev/2022022
--
Sidnei da Silva <sidnei at awkly.org>
http://awkly.org - dreamcatching :: making your dreams come true
http://www.enfoldsystems.com
http://plone.org/about/team#dreamcatcher
<z3D> dash: yup ... remember the word 'enterprise' ?
<dash> z3D: YES! it is one of my favorite words
More information about the Zope3-dev
mailing list