def _gmtime(timestamp):
    """Custom gmtime because yada yada.
    """
    try:
        return time.gmtime(timestamp)
    except OSError:
        dt = datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=timestamp)
        dst = int(_isdst(dt))
        return time.struct_time(dt.timetuple()[:8] + tuple([dst]))