code: def dtstr_to_datetime(dtstr, to_tz=None, fail_silently=True):
      
      try:
          dt = datetime.datetime.utcfromtimestamp(int(dtstr, 36) / 1e3)
          if to_tz:
              dt = timezone.make_aware(dt, timezone=pytz.UTC)
              if to_tz != pytz.UTC:
                  dt = dt.astimezone(to_tz)
          return dt
      except ValueError, e:
          if not fail_silently:
              raise e
          return None
docs: Convert result from datetime_to_dtstr to datetime in timezone UTC0.