[python-win32] Translating vbs GetObject("LDAP://...") to Pyt hon?

The Count the.count at count0.dyndns.org
Tue Nov 9 23:45:40 CET 2004

On Tue, 9 Nov 2004 17:08:16 -0500, R. Alan Monroe 
<amonroe at columbus.rr.com> wrote:

>> I'm looking at the
>> "PasswordLastChanged" property,
> If I do type() on the variable I assign it to, it says 'time', and it
> prints a sensible looking date like 10/25/04 11:18:59 to the screen.
> But I can't figure out how to compare that to, say, time.time(). How
> do I find out the number of elapsed days between the date it returns
> and the current date?
> I naively tried just subtracting one from the other, but all that gets
> me is TypeError: unsupported operand type(s) for -: 'float' and 'time'

Look at http://docs.python.org/lib/module-time.html
you probably want something like
mktime(strptime(your_time,"%m/%d/%y %H:%M:%S") if your_time is the 
"sensible looking date"-string from above ...
if your time variable is a struct_time (9-tuple) just use mktime.


The Count

More information about the Python-win32 mailing list