Create pywintypes.Time from an mx.DateTime.DateTime

Mark Hammond mhammond at skippinet.com.au
Fri May 24 11:24:20 EDT 2002


Mike Weiss wrote:
> I'm *very* new to python (C++ programmer)  so please bear with me if
> what
> I'm asking is completely stupid.
> I'm using both mxDateTime and the win32 extensions in python v2.2.
> 
> I'm trying to create a pywintypes.Time (a window's COM date (right?))
> FROM
> an mx.DateTime object. I can go the other way (pywintypes TO
> mxDateTime).
> 
> mx.DateTime.COMDate() returns a float, which I can't seem to use to
> initalize a pywintypes.Time object with. Pywintypes.Time only seems to
> be
> able to be created from the integer value used by the basic "time"
> module in standard python.

It can also be initialized with a standard Python "time tuple", as used 
by the time module.  I am not sure of the semantics of the mx objects, 
but I am sure they would allow you to get such a tuple very simply.

Mark.




More information about the Python-list mailing list