

def _strftime(pattern, time_struct=time.localtime()):
    'Custom strftime because Windows is shit again.\n    '
    try:
        return time.strftime(pattern, time_struct)
    except OSError:
        dt = datetime.datetime.fromtimestamp(_mktime(time_struct))
        original = dt.year
        current = datetime.datetime.now().year
        dt = dt.replace(year=current)
        ts = dt.timestamp()
        if _isdst(dt):
            ts -= 3600
        string = time.strftime(pattern, time.localtime(ts))
        string = string.replace(str(current), str(original))
        return string

dataset/ETHPy150Open KoffeinFlummi/Chronyk/chronyk/chronyk.py _strftime/original