[python-win32] Setting a 64bit FILETIME PT_SYSTIME property using pywin32's SetProps()

Mark Hammond skippy.hammond at gmail.com
Fri Dec 16 04:58:52 CET 2011


Attempting to pass an integer will assume the int is a regular "unix 
timestamp" and pywin32 will do the conversions as necessary.  So there 
should be no need to convert it to a 64bit FILETIME integer.  You should 
also find that passing a datetime object directly works, even in py2k 
builds - pywin32 will use the timetuple() method to perform the conversion.

Mark

On 21/11/2011 6:03 PM, Sriram ET. wrote:
> I am using pywin32 mapi routines to interact with my outlook contacts
> store. I am trying to set the PT_BIRTHDAY property and have the
> following code for doing that:
>
> The conversion from and to FILETIME values is from filetimes.py
> available at:http://reliablybroken.com/b/wp-content/filetimes.py
>
> |     dt = datetime.strptime('1980-01-01','%Y-%m-%d')
>      filetime = filetimes.dt_to_filetime(dt)
>      msg.SetProps([(mapitags.PR_BIRTHDAY, filetime)])
> |
>
> I get an OverflowError: Python int too large to convert to c long
>
> I am on a 32 bit machine, and I understand FILETME is a 64 bit value. I
> am at a loss. How can I set the underlying MAPI property using this
> library? Is there a workaround?
>
> (Setup: Outlook 2010, Window 7 running on a 32bit virtual machine via
> VMWare Fusion 4 on Mac OS X Lion)
>
> Thanks!
>
>
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32



More information about the python-win32 mailing list