PyTime stores times internally as DATE objects, which support fractional
second resolution (since they are just a double number of days).
However the method to retrieve attributes including msec uses the Win32
VariantTimeToSystemTime function to convert the m_time to a SYSTEMTIME.
This function is known not to convert the fractional part of seconds (see
http://support.microsoft.com/kb/297463, and
http://www.codeproject.com/KB/datetime/SysTimeToVarTimeWMillisec.aspx for
some example workaround code).
So although the fractional part is actually stored in the PyTime object, it
cannot be retrieved.
Nobody/Anonymous
win32
None
Public
|
Date: 2008-10-30 15:06 I've attached a very simple patch that calculates the .msec value on |
|
Date: 2008-10-30 14:47 A fairly simple workaround is to convert the PyTime directly to a float. |
| Filename | Description | Download |
|---|---|---|
| pywin32-pytime-calc-msec.patch | Patch to PyTime.cpp to calculate milliseconds | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| File Added | 299550: pywin32-pytime-calc-msec.patch | 2008-10-30 15:06 | davidfraser |