def getDate(date=None):
 if (date is None):
  return datetime.date.today()
 if isinstance(date, datetime.date):
  return date
 if isinstance(date, datetime.datetime):
  return date.date()
 if isinstance(date, (int, float)):
  return datetime.date.fromtimestamp(date)
 if isinstance(date, str):
  date = date.replace(' ', '0')
  if (len(date) == 6):
   return datetime.date(*time.strptime(date, '%y%m%d')[:3])
  return datetime.date(*time.strptime(date, '%Y%m%d')[:3])
 if hasattr(date, '__getitem__'):
  return datetime.date(*date[:3])
 return datetime.date.fromtimestamp(date.ticks())

def getDate ( date = None ) : if ( date is None ) : return datetime . date . today ( ) if isinstance ( date , datetime . date ) : return date if isinstance ( date , datetime . datetime ) : return date . date ( ) if isinstance ( date , ( int , float ) ) : return datetime . date . fromtimestamp ( date ) if isinstance ( date , str ) : date = date . replace ( ' ' , '0' ) if ( len ( date ) == 6 ) : return datetime . date ( * time . strptime ( date , '%y%m%d' ) [ : 3 ] ) return datetime . date ( * time . strptime ( date , '%Y%m%d' ) [ : 3 ] ) if hasattr ( date , '__getitem__' ) : return datetime . date ( * date [ : 3 ] ) return datetime . date . fromtimestamp ( date . ticks ( ) )
return datetime .