mx.DateTime formatting, need milliseconds

T

Troy

Hi-

I'm running Python 2.3 on Windows so I am using the mx.DateTime
package to parse timestamps from a log.

The timestamps are formatted like so:
2004-02-24 15:42:03,707

When I use the default formats for the getDateTimeFromString()
function, I lose the milliseconds. I can't find documentation
anywhere about how to write a format string for mx.DateTime so I can't
write my own format string.

I really need that data. Thanks!

Troy
 
M

M.-A. Lemburg

Troy said:
Hi-

I'm running Python 2.3 on Windows so I am using the mx.DateTime
package to parse timestamps from a log.

The timestamps are formatted like so:
2004-02-24 15:42:03,707

When I use the default formats for the getDateTimeFromString()
function, I lose the milliseconds. I can't find documentation
anywhere about how to write a format string for mx.DateTime so I can't
write my own format string.

I really need that data. Thanks!

mxDateTime has a strptime() parser that you could use,
but the Parser.DateTimeFromString() parser should be able
to parse the above as well (replace ',' with '.').

--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source (#1, Feb 27 2004)________________________________________________________________________

::: 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

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top