parameters: (self, obj)
docstring: Returns a ComDate from a date-time
docstring_summary: Returns a ComDate from a date-time
docstring_tokens: Returns a ComDate from a date - time
function: def COMDate(self, obj):
          """Returns a ComDate from a date-time"""
          try:  # most likely a datetime
              tt = obj.timetuple()
  
              try:
                  ms = obj.microsecond
              except:
                  ms = 0
              return self.ComDateFromTuple(tt, ms)
          except:  # might be a tuple
              try:
                  return self.ComDateFromTuple(obj)
              except:  # try an mxdate
                  try:
                      return obj.COMDate()
                  except:
                      raise ValueError('Cannot convert "%s" to COMdate.' % repr(obj))
function_tokens: def COMDate ( self , obj ) : try : # most likely a datetime tt = obj . timetuple ( ) try : ms = obj . microsecond except : ms = 0 return self . ComDateFromTuple ( tt , ms ) except : # might be a tuple try : return self . ComDateFromTuple ( obj ) except : # try an mxdate try : return obj . COMDate ( ) except : raise ValueError ( 'Cannot convert "%s" to COMdate.' % repr ( obj ) )