[python-win32] Python Dates and Windows dates

Christopher Nilsson can at optiver.com.au
Wed Jan 14 18:01:41 EST 2004


This is an example of how I'm doing this... Might not be exactly what 
you're after though.

import time, pywintypes

def COMDateToDate(comdate):
  """Expects a PyTime object (a COMDate) as input - see the pythoncom 
doco for info"""
  return time.localtime(int(comdate))
   
def DateToCOMDate(adate):
  """Expects a datetime object (from datetime module)"""
  return pywintypes.Time(adate.timetuple())

Cheers,
Chris.

Aaron Patrick Lehmann wrote:

>Hello--
>
>How do I translate from the python time format to Windows time format?
>
>Aaron Lehmann
>  
>


-- 
                   ______________________________
Chris Nilsson     |
Developer         |    Optiver Australia
m: 0428 880 242   |    Paddington, Sydney
w: 02 93334009    |    http://www.optiver.com.au
f: 02 93334044    |______________________________

Explicit leuctotem; da mihi potum






More information about the Python-win32 mailing list