import pytz


def _convert_to_utc(date, default_tz):
    """Convert date to UTC, using default_tz if no time zone is set."""
    if date is None:
        return date
    if date.tzinfo is None:
        date = default_tz.localize(date)
    date.astimezone(pytz.utc)
    # strip timezone info
    return date.replace(tzinfo=None)