How to? Python dates to COM dates?
gbreed at cix.compulink.co.uk
gbreed at cix.compulink.co.uk
Wed Nov 8 07:12:24 EST 2000
In article <iHaO5.153$cr6.889 at news1.oke.nextra.no>,
syver at NOSPAMcyberwatcher.com (Syver Enstad) wrote:
> Sorry, found it on page 107 of the Win32 Python Programming book,
> here's the answer if anyone else needs it.
>
> def MakeComTime(ctime):
> return (ctime / 86400.0) + 25569.0
> def MakeCtime(comtime):
> return (comtime - 25569.0) * 86400.0
Is that what you wanted, then? Here's how I'd do it:
import pywintypes, time
comtime = pywintypes.Time(time.time())
To make the two methods equivalent, take float(comtime)
Graham
More information about the Python-list
mailing list