def _convert_to_naive_utc_time(time):
 if (time.tzinfo is not None):
  offset = time.utcoffset()
  offset = (offset if offset else datetime.timedelta())
  return (time.replace(tzinfo=None) - offset)
 else:
  return time

def _convert_to_naive_utc_time ( time ) : if ( time . tzinfo is not None ) : offset = time . utcoffset ( ) offset = ( offset if offset else datetime . timedelta ( ) ) return ( time . replace ( tzinfo = None ) - offset ) else : return time
normalizes a datetime to a naive datetime in utc .