Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > mx.DateTime formatting, need milliseconds

Reply
Thread Tools

mx.DateTime formatting, need milliseconds

 
 
Troy
Guest
Posts: n/a
 
      02-27-2004
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
 
Reply With Quote
 
 
 
 
M.-A. Lemburg
Guest
Posts: n/a
 
      02-28-2004
Troy wrote:
> 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)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/

__________________________________________________ ______________________

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I display the current time *including milliseconds*? Al Koch Java 5 07-02-2005 01:26 AM
storing Milliseconds farseer Java 11 05-22-2005 09:26 AM
Simple Date Format - milliseconds with more precision brisco5@gmail.com Java 5 03-09-2005 01:27 AM
What a mess: Date, milliseconds, GregorianCalendar Erwin Moller Java 80 08-27-2004 11:05 AM
Newbie Question: How to return the current time in seconds or milliseconds? Michelle Java 5 08-17-2004 05:44 AM



Advertisments