def date_to_datetime(x):
 if ((not isinstance(x, datetime)) and isinstance(x, date)):
  return datetime.combine(x, time())
 return x

def date_to_datetime ( x ) : if ( ( not isinstance ( x , datetime ) ) and isinstance ( x , date ) ) : return datetime . combine ( x , time ( ) ) return x
convert a date into a datetime .