473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

mx.DateTime formatting, need milliseconds

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
Jul 18 '05 #1
1 2965
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 ! ::::

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Fritz Switzer | last post by:
I'd like to have a string assigned the value of a DateTime.AddMinutes(amount) so that the string is formatted in "HH:MM" format. For example: DateTime.Now.AddMinutes(30) returns "00:30" ...
3
by: Matthias S. | last post by:
Hi, I create a DateTime object in C# like this... DateTime _DateStart = new DateTime(2000, 1, 1, 1, 1, 1, 1); Now I save it to the Database (into a DateTime type of column) using the...
2
by: Daniel | last post by:
how to get the number of milliseconds between two System.DateTime objects
5
by: Nikeman | last post by:
good day, I simply would like to know as to how I can parse seconds to convert them into equivalent DateTime representation. To be more persice, I have a DirectShow app written in VB.NET, with a...
3
by: Mark | last post by:
I'd like to compare two datetime values in milliseconds. The datetime.compare method appears to show only seconds. Milliseconds of a datetime are available as a property of each datetime, but I...
6
by: Manikandan | last post by:
Hi, I need to insert the datetime with milliseconds value into a datarow. My code as below DataTable testDataTable=new DataTable(); testDataTable.Columns.Add("updatedDateTime",...
0
by: Chizl | last post by:
I think I found a bug DateTime.ToString when formatting under GMT. This took me about 15 to figure this has to be a bug in the formatting within ToString. I was adding support to allow browsers...
3
by: t8ntboy | last post by:
I am migrating data from one database to another. The process requires that I significantly modify the table and data structure. Therefore, I am exporting the data to a csv, making the adjustments...
0
by: maolimix | last post by:
Hi to all, I have a trouble with datetime...now I explain.. I must to store to a C# variable the values from a "Datetime column" of Sql Server 2005. I tried 3 methods ...in the first two I never...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.