from dateutil import tz


def datetime_local_to_utc(dt):
	"""
	Convert a :py:class:`datetime.datetime` instance from the local time to UTC
	time.

	:param dt: The time to convert from local to UTC.
	:type dt: :py:class:`datetime.datetime`
	:return: The time converted to the UTC timezone.
	:rtype: :py:class:`datetime.datetime`
	"""
	dt = dt.replace(tzinfo=tz.tzlocal())
	dt = dt.astimezone(tz.tzutc())
	return dt.replace(tzinfo=None)