[Python-Dev] New Subscriber Introduction

M.-A. Lemburg mal@lemburg.com
Tue, 25 Jun 2002 20:56:04 +0200


Brett Cannon wrote:
> [M.-A. Lemburg]
> 
> 
>>Just curious: have you taken a look at the mxDateTime parser ?
>>
>>It has a slightly different approach than strptime() but also
>>takes a lot of load from the programmer in terms of not requiring
>>a predefined format.
> 
> 
> No.  I originally wrote strptime a year ago and it was initially just a
>  hack.  It just has been fleshed out by me over the past year.  Just last
> month was when I realized how I could figure out all the locale info on my
> own after having taken a break from it.  I also wanted to avoid any
> possible license issues so I just did completely from scratch.

mxDateTime is part of egenix-mx-base which is covered
by an open source license similar to that of Python (with less
fuzz, though :-).

> As for your comment about not requiring a predefined format, I don't quite
> follow what you mean.  Looking at mxDateTime's strptime, the only
> difference in the possible parameters is the optional default for
> mxDateTime.  Otherwise both mxDateTime's and my implementation have
> exactly the same parameter requirements:
> mxDateTime.strptime(string,format_string[,default])
> strptime.strptime(data_string, format)
> 
> with string == data_string and format_string == format.

That's correct. I was refering to the mx.DateTime.Parser
module, which implements several different date/time parsers.

The basic interface is mx.DateTime.DateTimeFrom(string). No format
string is required.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                   http://www.egenix.com/files/python/
Meet us at EuroPython 2002:                 http://www.europython.org/