@classmethod
def format_z(cls, offset):
    """ Format `timedelta` into %z """
    sec = offset.total_seconds()
    return '{s}{h:02d}{m:02d}'.format(s='-' if sec < 0 else '+', h=abs(int(
        sec / 3600)), m=int(sec % 3600 / 60))
