<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def datetime_to_dtstr(dt=None):
 """ Comvert datetime to short text. If datetime has timezone then it will be convert to UTC0. """

    if dt is None:
        dt = datetime.datetime.utcnow()
    elif timezone.is_aware(dt):
        dt = dt.astimezone(tz=pytz.UTC)
    return int2base36(int(time.mktime(dt.timetuple()) * 1e3 + dt.microsecond / 1e3))