def __fromstring__(self, timestr):
        timestr = timestr.lower().strip().replace(". ", " ")

        # COMMON NAMES FOR TIMES
        if timestr in ["today", "now", "this week", "this month", "this day"]:
            return currentutc()
        if timestr in ["yesterday", "yester day"]:
            return currentutc() - 24 * 3600
        if timestr in ["yesteryear", "yester year"]:
            dati = datetime.datetime.utcnow()
            return _mktime(dati.replace(year=dati.year - 1).timetuple())

        # RELATIVE TIMES
        relative = self.__fromrelative__(timestr)
        if relative is not None:
            return relative

        # ABSOLUTE TIMES
        absolute = self.__fromabsolute__(timestr)
        if absolute is not None:
            return absolute

        raise ValueError("Failed to parse time string.")

    # Methods
dataset/ETHPy150Open KoffeinFlummi/Chronyk/chronyk/chronyk.py/Chronyk.__fromstring__/original