def _deadline_string_to_datetime(self, deadline: str,
                                     adjust: bool = True) -> datetime:
        dl = dp.parse(deadline, tzinfos=tzd)
        if dl.tzinfo is None:
            dl = dl.replace(tzinfo=pytz.utc)

        to = self._get_timeout(dl)

        if adjust and -86400 < to < 0:
            dl += timedelta(days=1)
        elif to < -86400:
            raise PastDeadlineError()

        return dl