def __fromabsolute__(self, timestr):
        # http://en.wikipedia.org/wiki/Date_format_by_country
        datetimeformats = [
            "%Y-%m-%dT%H:%M:%SZ",
            "%Y-%m-%dT%H:%M:%S%z",
            "%Y-%m-%dT%H:%M:%S%Z",
            "%c",
            "%s"
        ]
        dateformats = [
            # ISO
            "%Y-%m-%d",
            # YMD other than ISO
            "%Y%m%d",
            "%Y.%m.%d",
            # Popular MDY formats
            "%m/%d/%Y",
            "%m/%d/%y",
            # DMY with full year
            "%d %m %Y",
            "%d-%m-%Y",
            "%d/%m/%Y",
            "%d/%m %Y",
            "%d.%m.%Y",
            "%d. %m. %Y",
            "%d %b %Y",
            "%d %B %Y",
            "%d. %b %Y",
            "%d. %B %Y",
            # MDY with full year
            "%b %d %Y",
            "%b %dst %Y",
            "%b %dnd %Y",
            "%b %drd %Y",
            "%b %dth %Y",
            "%b %d, %Y",
            "%b %dst, %Y",
            "%b %dnd, %Y",
            "%b %drd, %Y",
            "%b %dth, %Y",
            "%B %d %Y",
            "%B %dst %Y",
            "%B %dnd %Y",
            "%B %drd %Y",
            "%B %dth %Y",
            "%B %d, %Y",
            "%B %dst, %Y",
            "%B %dnd, %Y",
            "%B %drd, %Y",
            "%B %dth, %Y",
            # DMY with 2-digit year
            "%d %m %y",
            "%d-%m-%y",
            "%d/%m/%y",
            "%d/%m-%y",  # why denmark?
            "%d.%m.%y",
            "%d. %m. %y",
            "%d %b %y",
            "%d %B %y",
            "%d. %b %y",
            "%d. %B %y",
            # MDY with 2-digit year
            "%b %dst %y",
            "%b %dnd %y",
            "%b %drd %y",
            "%b %dth %y",
            "%B %dst %y",
            "%B %dnd %y",
            "%B %drd %y",
            "%B %dth %y",
        ]
        timeformats = [
            # 24 hour clock with seconds
            "%H:%M:%S %z",
            "%H:%M:%S %z",
            "%H:%M:%S",
            # 24 hour clock without seconds
            "%H:%M %z",
            "%H:%M %Z",
            "%H:%M",
            # 12 hour clock with seconds
            "%I:%M:%S %p %z",
            "%I:%M:%S %p %Z",
            "%I:%M:%S %p",
            # 12 hour clock without seconds
            "%I:%M %p %z",
            "%I:%M %p %Z",
            "%I:%M %p"
        ]

        # Prepare combinations
        for dateformat in dateformats:
            for timeformat in timeformats:
                datetimeformats.append("{} {}".format(dateformat, timeformat))
            datetimeformats.append(dateformat)

        # Date / Datetime
        for dateformat in datetimeformats:
            try:
                struct = time.strptime(timestr, dateformat)
            except ValueError:
                pass
            else:
                timestamp = _mktime(struct)
                if "z" not in dateformat.lower():
                    # string doesn't contains timezone information.
                    timestamp += self.timezone
                return timestamp

        # Time (using today as date)
        for timeformat in timeformats:
            timestr_full = _strftime("%Y-%m-%d") + " " + timestr
            format_full = "%Y-%m-%d {}".format(timeformat)
            try:
                struct = time.strptime(timestr_full, format_full)
            except ValueError:
                pass
            else:
                timestamp = _mktime(struct)
                if "z" not in timeformat.lower():
                    # string doesn't contains timezone information.
                    timestamp += self.timezone
                return timestamp
dataset/ETHPy150Open KoffeinFlummi/Chronyk/chronyk/chronyk.py/Chronyk.__fromabsolute__/original