string to datetime parser?

B

beza1e1

Is there a library which can parse strings and output a datetime
object? It should be as magical as possible and allow things like:
12:30
tomorrow
10.10.2005
02-28-00
28/03/95
1995-03-28
1996.Feb.29 (Thu) 16:45:23.7

Is there anything like that out there? My Google can't find anything
useful ...
 
F

Fuzzyman

Is there a library which can parse strings and output a datetime
object? It should be as magical as possible and allow things like:
12:30
tomorrow
10.10.2005
02-28-00
28/03/95
1995-03-28
1996.Feb.29 (Thu) 16:45:23.7

Is there anything like that out there? My Google can't find anything
useful ...

There is a module called DateUtil which will do *most* of what you
want. (Possibly all).

I can't recall the URL, but google should turn it up for you.

All the best,


Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
 
S

Sybren Stuvel

beza1e1 enlightened us with:
Is there a library which can parse strings and output a datetime
object?

If you're happy with a mx.DateTime object, take a look at its parser.

Sybren
 
T

Tim Roberts

beza1e1 said:
Is there a library which can parse strings and output a datetime
object? It should be as magical as possible and allow things like:
12:30
tomorrow
10.10.2005
02-28-00
28/03/95

And given 10/03/95, is that a date in mid-March, or in early October?
 
B

beza1e1

A good solution may be to specify a language to determine the order.
The default would be (something like) "en-US" and thus early October in
the example.
 
M

M.-A. Lemburg

beza1e1 said:
Is there a library which can parse strings and output a datetime
object? It should be as magical as possible and allow things like:
12:30
tomorrow
10.10.2005
02-28-00
28/03/95
1995-03-28
1996.Feb.29 (Thu) 16:45:23.7

Is there anything like that out there? My Google can't find anything
useful ...

http://www.egenix.com/files/python/mxDateTime.html

--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source (#1, Jan 13 2006)________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top